Forums Forums Search & Filter Pro Start filter search with no preloaded results.

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

    Hi There!
    Awesome plugin.

    I’m using it on this site: http://artseverywhere.ca/contributors/
    The site is a bit unusual since there will be a ton of authors so this plugin had been great.

    I can’t seem to figure out how to display the search box without any preloaded search results, just have them show when the visitor searches for any of the authors.
    Any advise on how I can accomplish this?

    This is the way I’m loading it to the page:
    [searchandfilter id=”1726″]
    [searchandfilter id=”1726″ show=”results” orderby=”DESC” ]

    Trevor
    #42126

    I think that you ask the same question as here:

    https://support.searchandfilter.com/forums/topic/no-initial-results/

    It IS possible, but you would need to do some coding and the code would be dependent on your theme and the code already present in the theme templates.

    Anonymous
    #42786

    Thanks Trevor!
    I am using a theme I started from underscores template

    Installed the results.php template and I am trying to use the github code here as reference.
    but no luck yet..

    Any chance you can guide me a bit further?

    Where do I place the following code in my results.php if it needs to be before the “have_posts” loop?

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1726)->current_query();
    echo $sf_current_query->is_filtered();
    Trevor
    #42840

    Hi

    It should look like this a bit, I think:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1726)->current_query();
    if ($sf_current_query->is_filtered()) {
    // do the loop
    } else {
    // do something else
    }
    Anonymous
    #42872

    Worked!
    Thank you thank you Trevor!

    Trevor
    #43062

    Can I mark this thread as resolved and close it?

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