Forums Forums Search & Filter Pro Prevent empty search fetching results

  • This topic has 4 replies, 2 voices, and was last updated 7 years ago by Anonymous.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Trevor
    #185868

    If you are using the Shortcode results method, and our results.php template file, it would look like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1024)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // your template archive code/loop OR results.php code here
    }

    Change 1024 to the ID number of your form (from the form shortcode).

    Anonymous
    #185878

    Hi – yes, using standard shortcodes – so, I need to edit the results.php template as above to make it work as we need do I?

    Trevor
    #185886
    Anonymous
    #185898

    OK great – thanks

Viewing 4 posts - 1 through 4 (of 4 total)