Support » Fixing WordPress » Causing a category to not display on the blog/home page

  • Resolved henrylemmon

    (@henrylemmon)


    I am using my front page as a static page and my blog is named blog. how can I run a conditional to check if the blog page is loaded so I can exclude one of the category’s from displaying in the blog page?

    <?php
    if ( is_home()) {
    query_posts($query_string . ‘&cat=-17&posts_per_page=3’ );
    }
    ?>

    the above code is in the codex but it does not work for me, it just performs the same query over and over and offers me older posts -> and newer posts -> links and the older post link leads to the 404, mabye the query_string var is not storing the prev query info?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter henrylemmon

    (@henrylemmon)

    The code above will exclude category 17 from the query and retrieve only 3 posts. actually the first three posts in reverse chronological order excluding category 17, but the navigation links only load up the same three pages each time although they seem to be counting pages because the links appear appropriately based on the amount of posts and which post is supposedly being displayed.

    Thread Starter henrylemmon

    (@henrylemmon)

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Causing a category to not display on the blog/home page’ is closed to new replies.