Forums Forums Search & Filter Pro Return Custom Message if no results available

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #210555

    Is there a callback function for when search results = 0? I’d like the page to not display blank if the search params don’t match any of the posts.

    Trevor
    #210569

    This would normally be in the template file that delivers the post loop to the page, which should be coded like this:

    if ( $query->have_posts() ) {
      while ($query->have_posts()) {
        $query->the_post();
    // output the post here
      }
    } else {
      echo "No Results Found";
    }
Viewing 2 posts - 1 through 2 (of 2 total)