• Hi,
    Is there any way to check in if the query has empty result in the code. for ex. in single.php

    I 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

    • This topic was modified 8 years, 1 month ago by wooody.
    • This topic was modified 8 years, 1 month ago by wooody.
    • This topic was modified 8 years, 1 month ago by wooody.
    • This topic was modified 8 years, 1 month ago by wooody.
  • The topic ‘Check if query empty’ is closed to new replies.