Excluding Categories .. doesnt display error if there are no more posts
-
After having a look at the codex for the loop i tried the same but it doesn’t display error message. I am just pasting the below mentioned code in single.php
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!– If the post is in the category we want to exclude, we simply pass to the next post. –>
<?php if (in_category(‘3’)) continue; ?><div class=”post”>
<h2>“><?php the_title(); ?></h2>
<small><?php the_time(‘F jS, Y’); ?></small>
<div class=”entry”>
<?php the_content(); ?>
</div><p class=”postmetadata”>Posted in <?php the_category(‘, ‘); ?></p>
</div> <!– closes the first div box –><?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>This message is not displaying
Sorry, no posts matched your criteria.
- The topic ‘Excluding Categories .. doesnt display error if there are no more posts’ is closed to new replies.