• Resolved deckster0

    (@deckster0)


    Hello, I want to create a page that will only display posts from category id, let’s say #8.

    How do I do that?

Viewing 1 replies (of 1 total)
  • just before “the loop” in your pages you can do:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
    <?php if ( in_category(8) ) query_posts('cat=8&paged='.$paged); ?>

    the $paged variable allows it to paginate properly based on category, if you’re using it in your index, archives or search

Viewing 1 replies (of 1 total)
  • The topic ‘Display only posts from specific cateogry?’ is closed to new replies.