WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Excluding category from home page screws up post count (3 posts)

  1. TomJohnson
    Member
    Posted 4 years ago #

    I'm excluding a category from my home page, but it's screwing up the post count for the home page. My home page (idratherbewriting.com) is supposed to show at least 10 posts. However, if 4 of my recent posts are in my hidden category, the home page only shows 6 recent posts. How do exclude a category from my home page without having that excluded category's posts count towards the specific number of posts to show on the home page?

  2. MichaelH
    Member
    Posted 4 years ago #

    Before your loop to exclude category 1:

    <?php
    query_posts($query_string . '&cat=-1');
    ?>
  3. TomJohnson
    Member
    Posted 4 years ago #

    Thanks MichaelH. What you wrote works perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic