Я использую wp_query
<?php
$custom_query = new WP_Query( $args );
if ( $custom_query->have_posts() ) {
while( $custom_query->have_posts() ) { $custom_query->the_post();
?>
<div>News</div>
<?php
}
if ($custom_query->max_num_pages > 1) {
$orig_query = $wp_query;
$wp_query = $custom_query;
the_posts_pagination(array(
'show_all' => true
));
$wp_query = $orig_query;
}
wp_reset_postdata();
} ?>
И я бы хотел узнать могу ли я как то вывести сообщение "Нечего не найдено" в случае если WP_Query не найдет посты