Loop exclude posts from main page
-
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?
* * * * *
<div id=”rap”>
<div id=”content”><?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<div class=”post”>
<h3 class=”storytitle” id=”post-<?php the_ID(); ?>”><?php the_title(); ?></h3>
<div class=”storycontent”>
<?php the_content(); ?>
</div><!–
<?php trackback_rdf(); ?>
–>
</div><?php endforeach; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
<?php endif; ?>
</div>Thank you,
Janet
- The topic ‘Loop exclude posts from main page’ is closed to new replies.