WordPress.org

Ready to get started?Download WordPress

Forums

How can I exclude posts from a particular category? (2 posts)

  1. pcmt
    Member
    Posted 8 years ago #

    I'm using multiple loops in accordance with "Multiple Loops Example 3 - Multiple Loops in Action" from The_Loop page of the Codex. All is well, but I would now like to exclude posts from a specific category in the second loop. My second loop begins with:

    <?php if (have_posts()) : while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

    I'm having trouble making the exclusion work. The category ID I want to exclude posts from is 7.

    Can anyone help with this? Can I achieve the desired effect by amending the above line of code, or is it more complex than that?

  2. syrupcore
    Member
    Posted 8 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic