Forums › Forums › Search & Filter Pro › No results when searching for all post types
- This topic has 17 replies, 2 voices, and was last updated 9 years, 9 months ago by
Anonymous.
-
Ross Moderator(Private) December 14, 2015 at 9:39 am #32141
Hi Manuel
Ok so it looks like you have some code somewhere that is being too greedy and affecting queries with custom post types.
Basically, its probably a greedy
pre_get_posts
filter or another plugin (or possibly your theme) thats causing the issue.I would start by disabling all your plugins and see if it starts working.
If not, I would test on a default WP theme as it could be here.
Once we know where the issue is then we can get it working.
Anonymous(Private) December 15, 2015 at 10:04 am #32216I checked all plugins and it seems that Search & Filter interferes with The Events Calendar. I need both, so currently I’m looking into the calendar plugin.
Ross Moderator(Private) December 15, 2015 at 11:22 am #32222Hi Manuel
It seems that plugin is adding on filters to queries its not supposed to.
If you were to create a new WP_Query somewhere in your theme, for creating custom loops or anything like that, then this plugin would modify that query – and that shouldn’t be happening.
I can see its a very popular plugin, but, I’m sure that this is wrong.
It should only add filters to queries that it needs to modify – not all queries.
S&F actually used to do this by mistake in a very old version – and interfere with other queries that S&F should not be using. This was because the filter was not removed after it was added.
The solution is to remove the filter – something like:
remove_filter( 'posts_join', array( __CLASS__, 'posts_join' ), 10, 2 );
Do you see that anywhere in the plugin code?
Thanks
Anonymous(Private) December 15, 2015 at 11:44 am #32227Hi Ross,
thanks for your answer. I didn’t find the remove_filter(), but for now I just commented it out and it works for me. I don’t know if you wanna get in contact with them (from developer to developer) or if they’ll remove it anyway. But for me, this workaround works.
Best regards
Manuel -
AuthorPosts