Forums › Forums › Search & Filter Pro › Filter not filtering
Tagged: filter results
- This topic has 15 replies, 2 voices, and was last updated 10 years, 4 months ago by Ross.
-
Anonymous(Private) July 6, 2014 at 11:36 am #2192
Hi Ross – Have got the plugin doing what I want in terms of hierarchy/show count etc. (your interface makes that nice and easy, so great job). But the filters simply aren’t filtering the results (even though it has the count right). I have tried Ajax/non-Ajax & tried changing the search operator etc. but no joy.
Would you mind taking a look and telling me what’s wrong? the site is http://http://ongrowthhacking.com/reviews/
You’ll see that it doesn’t matter what filters you set, you always get all posts returned (you can see the tags/categories for each post if you click through, I hide the meta on the homepage)
Also, whilst writing I second/third the feature request I saw for only showing the categories that apply to the custom post type being used. This would save me having to remember to exclude the cat IDs.
Thanks
Jon
Ross Moderator(Private) July 7, 2014 at 1:37 pm #2209Hey Jon
Sorry I thought I replied to this at the weekend, yeah that feature request is a big one, but unfortunately its a huge amount to code – so progressing as fast as I can!
RE your problem, did you by any chance not select the correct custom post type for your searches?
On second look, it seems as if S&F is not taking hold of your main query and modifying the results – do you have any custom code that hooks in to pre_get_posts or another plugin interfering?
A user did report a problem conflict with a BBPress plugin for which he supplied a workaround.
Try disabling other plugins to see if the problem still persists so that I may be able to identify where the problem lies exactly.
Thanks
Anonymous(Private) July 7, 2014 at 2:15 pm #2217Hi Ross – yes the correct post type is set, which in my case is a custom post type called ‘reviews’.
I’ve just tried switching off various plugins but that hasn’t done the trick. (I’m not using BBPress)
As far as I am aware i’m not hooking into pre_get_posts with any custom code (although I do have quite a bit of custom code in my child theme)
If you would like a login to my site so you can have a look at it, let me know?
Not sure if this helps, I was using another filter plugin called ‘Ultimate WP query search filter’ that worked fine (assuming it uses the same method for filtering, hence why I’m mentioning it), but upgraded to yours because it can’t handle counts & hierarchies etc.
Ross Moderator(Private) July 8, 2014 at 1:49 pm #2264Hey Jon, sure fire over your login details and I’ll take a look 🙂
Ross Moderator(Private) July 9, 2014 at 1:28 pm #2288Hey Jon
I’ve figure out where the issues lies, your template (and most likely your theme) runs its own custom query on the page and displays them, so the results you see are not from the main loop/query that the page uses.
For example in your template
allreviewspage.php
you have<?php query_posts( 'post_type=reviews'); ?>
Your template should use the main loop and not a custom query, so I would suggest modifying the template to instead work with the loop (http://codex.wordpress.org/The_Loop)
If you create a blank template, and follow the instructions there you will notice you get the correct results, its then all about getting your layout working with the proper WP loop…
Make sense?
-
AuthorPosts