BBP Results Showing in WordPress search
-
My site is running mainly CPTs but I filter my search results to a subset of these using this technique:
function filter_search($query) { if ($query->is_search) { $query->set('post_type', array('A','B', 'C')); }; return $query; }; add_filter('pre_get_posts', 'filter_search');
which works fine for wordpress but when I search within BBP i get the ‘Oh bother! No search results were found here!’ message as you’d expect because of the above filter.
If i remove the filter the BBP search works fine, and if I add ‘forum’, ‘topic’, ‘reply’ to the above filter BBP search works fine, but the problem is get I the forum results appearing in the main search results page.
Also, If i remove the filter all together I still get forum results appearing in the main results page.
Is there a way to exclude forums results from appearing in the main search?
- You must be logged in to reply to this topic.