WordPress.org

Support

Support » How-To and Troubleshooting » category excluded on home page throws off number of posts per page

category excluded on home page throws off number of posts per page

  • I put the following code on my home page:

    <?php if (in_category(’12’) && is_home() ) continue; ?>

    I wanted 10 posts to display on each page. If I have, say 2 posts from that category, only 8 are displayed on the home page. Is there any way to fix this? I am using 2.0.1.

Viewing 2 replies - 1 through 2 (of 2 total)
  • mkallen: So, you’re excluding a single category from your homepage. That is the most obvious way to do it, but as you found, it has drawbacks. The other way to do it is to modify the main loop query to exclude the posts you don’t want to see.

    And I could go into extreme detail here, but there’s really no point when there’s plugins to do it all for you.

    Category Visibility: http://ryowebsite.com/?p=46

    It lets you decide which posts show up where. Very handy.

    Wow! Thanks, Otto42. That’s exactly what I needed!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘category excluded on home page throws off number of posts per page’ is closed to new replies.