I would like to exclude certain categories from the home page. I have tried the recommended tag:
<?php if (in_category(‘3’) && is_home() ) continue; ?>
However, it is not working. Where exactly would I put it? Perhaps that is what I’m doing wrong.
Here is what I have. Can you please let me know where the above tag would be placed?
* * * * *
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<h3 class=”storytitle” id=”post-<?php the_ID(); ?>”><?php the_title(); ?></h3>
<?php the_content(); ?>
<?php trackback_rdf(); ?>
<?php endforeach; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
<?php endif; ?>
- The topic ‘Loop exclude posts from main page’ is closed to new replies.