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?
- The topic ‘How can I exclude posts from a particular category?’ is closed to new replies.