• Resolved Spencer24

    (@spencer24)


    Could anybody tell me how to prevent any posts in category ID=18 appearing in the posts on my home page.

    I think I have seen code that did this by writing a filter in the functions.php.

    Using WordPress 2.7.1

    kind regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Spencer24

    (@spencer24)

    Thanks for your reply tried what you said but it took ages for my page to load and it gave me approx 24 versions of the same post and my side bars and footers disappeared

    Below is the code I used

    <?php
    if (is_home()) {
    query_posts(“cat=-18”);
    }
    ?>

    Regards

    And *where* did you place that? If it gave you 24 version of the same page, then I’m guessing you put it *within* the Loop. The “query” goes *outside* the Loop.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent specific posts on home page’ is closed to new replies.