I am trying to create a page that will display all the posts within a category. All the posts within this category are excluded from the main blog page. These would be posts within a podcast category displayed in a “audio” page.
So I have the template page called, Podcasts.
Then I created a page, with a meaningless title and a blank body. Usings is template basis as “Podcasts”.
The podcast template page has this code.
<?php /** * @package WordPress * @subpackage Default_Theme */ /* Template Name: Podcasts */ ?> <?php get_header(); ?> <?php $recentPosts = new WP_Query(); $recentPosts->query('cat=3'); while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> </div> <h1 id="legend" style="background-image: url('<?php bloginfo('stylesheet_directory'); ?>/images/text/header/<?php echo urlencode(trim(strtolower(wp_title('', true))));?>');"><?php wp_title();?></h1> <div id="pane"> <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> </div> <?php endwhile; ?> <?php get_footer(); ?>
This is what I get displayed.
I would like to achieve the ‘post’ with the category as the title in the brown. And then line up each ‘post’ down the right side, similar as the first one.
If I need to give any more code or CSS just let me know. I am not sure I gave everything needed to answer.
Please help quickly.
- The topic ‘All Posts in Category in Page’ is closed to new replies.