Check if query empty
-
Hi,
Is there any way to check in if the query has empty result in the code. for ex. in single.phpI did it on this way: (but still think there is better way)
<?php $query9 = do_shortcode('[query id=9]'); $class = 'query-empty'; $is_empty = preg_match('/<div class="[^"]*'.$class.'[^"]*">/', $query9); if (!$is_empty): <!---Print Code here--> endif;?>
is there any API , filter or functions that we could use in the code?
Thanks
is there any API , filter or functions that we could use in the code?
Thanks
- The topic ‘Check if query empty’ is closed to new replies.