conditional statements when category has no posts display message
-
Hi, i want to add a message so if a catagory doesnt have any posts a message is display saying so, “sorry no posts”.
Im am using a list of conditional staments for a sidebar and would like to use it here:
<ul class="rightcol"> <?php global $post; $myposts = get_posts('numberposts=10&category=18'); foreach($myposts as $post) :?> <li><span class="threecolsmall"><?php the_time('j M y') ?></span><br /> <a href='<?php the_permalink() ?>'><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>
not sure how to add this into the PHP.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘conditional statements when category has no posts display message’ is closed to new replies.