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)