Support » Themes and Templates » Display all posts in a specific category

  • Resolved ericakadisco


    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>
    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this page &raquo;
    '); ?>
    <?php link_pages('<strong>Pages:</strong> ', '
    ', 'number'); ?>
    <?php endwhile; endif; ?>
    <?php edit_post_link('Edit this entry.', '', '
    '); ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>


Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to create a category specific template, not a Page.


    Ah, okay. I see. I created a file called it Category-8.php and uploaded it to my blog root. Then in my header I linked the page ‘Reviews’ to go to the page

    <a href="?cat=8">Reviews</a>

    In my header. And now I can just mess around with the Category-8.php to make it look how I want.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display all posts in a specific category’ is closed to new replies.