Я показываю массив сообщений по следующему коду. Когда нет сообщений для отображения, я хочу распечатать уведомление, например. «Нет сообщений для отображения». Как это может быть сделано?Как отправить сообщение, если нет сообщений для отображения
<?php
while (have_posts()) :
the_post();
?>
<h1><?php the_title();?></h1>
<section class="intro">
<?php the_content(); ?>
</section>
<?php endwhile; // end of the loop. ?>
<h2>Latest Events</h2>
<?php
query_posts(array('category__and' => array(8)));
if (have_posts()) while (have_posts()) :
the_post();
?>
<article class="events clearfix">
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php the_excerpt(); ?>
<div class="date">
<span class="month"><?php the_time('M') ?></span>
<span class="day"><?php the_time('d') ?></span>
</div>
</article>
<?php endwhile; ?>