Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Displaying results on load

Viewing 5 posts - 1 through 5 (of 5 total)
  • Steve Jones
    #176835

    Hi, I use the shortcode to display results on a page. When the page initially loads it displays all results by default without anything being filtered from the sidebar widget form options. Is there a ways to show a blank page until the user selects any filter options?
    Thanks,

    Steve Jones
    #176839

    I think I may have found a work around by setting opacity: 0 on #search-filter-results-1751 ID in css by default for the results page, then when someone clicks on one of the filters the opacity changes and shows the filtered results. If theres another way let me know,

    Thanks,

    Trevor Moderator
    #176841

    Are you using our shortcode display results method? If so, edit the results.php file to use code like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1024)->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/loop OR results.php code here
    }

    Change 1024 to the ID number of your form (from the form shortcode).

    Make sure you are working on a copy of the results.php file in a search-filter sub-folder of your theme/child theme folder, and not the original in our plugin template folder.

    Steve Jones
    #176848

    Hi ok i can try that, but the opacity: 0 on the css seems to do the trick, bit of a fudge but seems to be ok. The opacity changes when results change on the page so by setting it to 0 by defaults gives a blank results page until filter options applied, giving opacity 1.

    Steve Jones
    #176851

    Hi, yes your right editing the results.php worked better, placed in child theme.

    Thanks,

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

The topic ‘Displaying results on load’ is closed to new replies.