Forums Forums Search & Filter Pro Do not show result when opening page

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #230811

    Hello I would like to know if it is possible to show the result only when it is clicked on the submit button.
    The problem is that when I open the page the result is already displayed on the screen.

    Trevor
    #230812

    Are you using our Shortcode Display Results method, or a different one, if so, which one?

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #230852
    This reply has been marked as private.
    Trevor
    #230887

    You would need to be using our Shortcode Display results method (as you are), and have followed the ‘guide to customising’:

    https://support.searchandfilter.com/documentation/search-filter-pro/search-results/using-a-shortcode/

    Once you have a copy of the results.php file in a search-filter sub-folder of your theme, you can edit that file, like this (leave the PHP comments at the top outside and before this code):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1605)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // the theme template PHP code here
    }
Viewing 4 posts - 1 through 4 (of 4 total)