Start with no results

Forums › Forums › Search & Filter Pro › Start with no results

Viewing 7 posts – 1 through 7 (of 7 total)
  • Anonymous
    #195935

    Is it possible to start the page with no results displayed, and only display after a particular filter or filters are selected?

    Thanks

    Trevor
    #195938

    Are you using the shortcode method to display the results, or another method?

    Anonymous
    #195943

    Hi I’m using a custom page with

    $taxonomy_query = new WP_Query( array(
      'post_type' => 'countries',
      'search_filter_id' => '1033',
      'post_status' => 'publish',
      'orderby' => 'title',
      'order' => 'ASC',
    ) );

    Thanks,
    D

    Trevor
    #195947

    Ah, you would need to code it in your PHP template then, much like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1033)->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 here
    }
    Anonymous
    #195963

    Ah but that’s not going to work with AJAX enabled unfortunately.

    Trevor
    #195969

    It would if the code was inside the AJAX container on the page?

    This code is the only way it can be done.

    Anonymous
    #195971

    I do apologise, you’re absolutely correct.

    Thanks for your help, please feel free to close it.

Viewing 7 posts – 1 through 7 (of 7 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.