Forums Forums Search & Filter Pro Results showing without any search

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #21638

    Hi

    I’ve installed the pro version on my dev site. Just have one odd issue. I’m using the shortcode method to display the search form and results on the same page (as recommended). When I visit the page it’s displaying all results without any search being performed.

    I have auto submit turned on, but results are showing on the initial page load, so before the user has searched for anything.

    I’m using it on a custom post and taxonomy.

    Any thoughts why this is happening? WP_Query contains search results so it seems to be triggering for some reason.

    WP 4.2.2 running on AWS EC2 instance with LAMP stack. Latest version of the plugin is installed.

    Ross Moderator
    #21795

    Hi Chris

    This is actually the way it is intended.

    Your search results page is an “unfiltered” list of items that match your settings, you narrow them down by searching & filtering.

    I understand that there is another use case here so am adding in an option for this in the next version.

    Otherwise you could hide the results with CSS for now, and show them when an an ajax request has completed – see link for ajax events – http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/

    Thanks

    Anonymous
    #21815

    Thanks, that worked a treat.

    Would be great to have the option to turn off that behaviour. We have 1,500 files to search through so we need to have no results initially.

    Cheers

    Chris

    Ross Moderator
    #21817

    Ah cool, just so you know, next version of S&F has a caching system built in which makes searching/browsing large DBs a lot faster 🙂

    Anonymous
    #21824

    Sounds great!

    May be something you want to add in to your next release as well… I needed to be able to filter the taxonomy list so that certain parent/sub categories were not displayed. There didn’t seem to be an easy way to do this, so I added a filter to your code (public/includes/class-search-filter-taxonomy-walker.php) to the display_element.

    if (apply_filters(‘check_taxonomy’, $element, $children_elements, $depth))
    parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );

    Worked a treat.

    Really great plugin, btw!

    Anonymous
    #101840

    Hi,

    Was wondering if this option to hide results by default has been enabled in the latest version. I require this functionality too.

    I tried by setting the style for the results div with id “sfresults” to “display:none” in the css file and then added the below code in footer.php but it does not work. The hidden div on page load does not change its style on completion of ajax request.
    *****************************

    *****************************

    Please help.

    Ross Moderator
    #101872

    Wrap it in a function should work as loading the script in the footer directly has no dependency, so jquery or S&F might not even be loaded properly –

    <script>
    (function ( $ ) {
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    		console.log("ajax complete");
    		//so load your lightbox or JS scripts here again
    		document.getElementById("sfresults").style.display = "inline";
    	});
    }(jQuery));
    </script>

    You can actually check in your results template (no need for JS) if something has been filtered, to display alternate content, check out this reply –

    https://support.searchandfilter.com/forums/topic/search-and-filter-issues/#post-97498

    And docs:

    https://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/#Check_to_see_if_anything_has_been_filtered

    Best

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