empty results by default

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)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.