【发布时间】:2015-03-22 05:12:26
【问题描述】:
如果某个类别没有帖子,我会尝试显示消息
<?php $recent = new WP_Query("cat=9&showposts=10");
while($recent->have_posts()) : $recent->the_post();?>
<?php the_title(); ?>
<?php the_content();?>
<?php endwhile; ?>
但是当我添加一个“else”时,我得到了空白屏幕
<?php else: ?>
message ////
<?php endif; ?>
【问题讨论】:
标签: php wordpress categories posts