Forums Forums Search & Filter Pro empty results by default

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #254382

    how not to see the results until I have made a choice in the search & filter menu.
    thanks
    Luciano

    Trevor
    #254383

    Are you using our Shortcode Display Results method. If not, you would need to be using a method that uses a (simple) theme PHP template and be abel to add code like this (the ID number needs to match your form):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1234)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // the current (filtered) posts output code here
    }
    Anonymous
    #254392

    I am using the shortcode method and results appear even though I have not chosen any option from the drop down menu. I wish they only appeared after the choice.
    thanks

    Trevor
    #254399

    Then edit the results.php file, as described here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    The code already there needs to be cut and placed inside the code I just gave you.

    Anonymous
    #254400

    work!! 1000 thanks

    Trevor
    #254408

    Thanks for letting me know. I will close this thread for now.

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