Forums › Forums › Search & Filter Pro › Filter not working.
- This topic has 7 replies, 2 voices, and was last updated 10 years, 8 months ago by
Ross.
-
Anonymous(Private) May 27, 2015 at 4:15 pm #18323
I’ve installed the search filter and set up my taxomnies and other things to search by, i have tried everything! but some some reason instead of display results it just displays every single post.
I have a custom template called properties.php and this is the template for the page and what the results should show on, I’m using a standard wordpress loops, i even grabbed the one from the wordpress price to see if it works.
It filters by price, but thats it, My taxomnoies are set up fine as far as i’m aware.
I’ve tried all the normal, different loops, disabled all plugins..nothing seems to work.
I can send over login details if you want to have a poke around, but via email not through this site.
the site is http://inhomeestates.co.uk/beta/
Ross Moderator(Private) May 27, 2015 at 7:48 pm #18351Hi Daniel
It seems as though the JS file for S&F is not being loaded – so you will probably find that ajax doesn’t work or auto submit amongst other things.
What I expect to see in hte html source is a reference to
search-filter-build.jsIs there anything you can think of as to why it might not be loading on your site?
Thanks
Anonymous(Private) May 29, 2015 at 10:55 am #18471Should the plugin not auto add that JS file? I pretty much installed the plugin thats it and tried to make it work with the theme i’m using a standard wordpress loop.
Auto submit is also on.
I’m not sure why its doing this, it needs to be sorted as soon as possible really, Would you mind having a look see what the problem is? i can send over login details etc.
thank you.
Ross Moderator(Private) May 29, 2015 at 12:06 pm #18472Hi Daniel,
The plugin of course adds this, which is why I asked if you could think of a reason that it wouldn’t be showing up.
This plugin lazy loads the JS, so its not loading the JS files on all your pages (ie pages where its not needed) – but it seems that maybe your theme doesn’t support this or has some non standard way of handling scripts.
For now you can add this to your functions.php:
wp_register_script( 'search-filter-plugin-build', 'http://www.yoursite.com/wp-content/plugins/search-filter-pro/public/assets/js/search-filter-build.js', array('jquery'), '1.4.3' ); wp_localize_script('search-filter-plugin-build', 'SF_LDATA', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'home_url' => (home_url('/')), 'sfid' => '' )); wp_register_script( 'search-filter-chosen-script', 'http://www.yoursite.com/wp-content/plugins/search-filter-pro/public/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.4.3' ); wp_enqueue_script( 'search-filter-plugin-build' ); wp_enqueue_script( 'search-filter-chosen-script' ); wp_enqueue_script( 'jquery-ui-datepicker' );Which will add the scripts back in to you site (obv replace “yoursite.com”).
I will add an option the next version so that you can choose to enable lazy loading.
Thanks
Ross Moderator(Private) June 1, 2015 at 11:35 am #18596You didn’t replace “yoursite.com” in the above code snippet.
Thanks
Ross Moderator(Private) June 2, 2015 at 12:20 pm #18718Hi Daniel
What’s happening here is your search form is inside your “results container” (this setting can be found on the “display results” tab).
So when an ajax request is performed, contents of your results container is reloaded – and in your case, the search form is also being reloaded which means it loses the JS events handling the search itself.
So I would recommend to change the results container selector to be a CSS selector that only contains your results specifically and nothing else.
Thanks
-
AuthorPosts