This seems easy but for some reason I can’t figure it out.
I am trying to create a template page that shows only posts from a specific category. I would like to display the full posts, not just the titles of the posts.
The page is called Reviews and will have all posts in the category Reviews, which is category ID 8.
This is the code I have so far. It shows the header but does not display any posts.
Template Name: Reviews
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<?php the_content('<p class="serif">Read the rest of this page »
<?php link_pages('<strong>Pages:</strong> ', '
', 'number'); ?>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '', '
<?php get_sidebar(); ?>
<?php get_footer(); ?>
- The topic ‘Display all posts in a specific category’ is closed to new replies.