I placed the following code into my functions.php file:
function filter_search($query) {
if ($query->is_search) {
$query->set('post_type', array('topic', 'reply'));
};
return $query;
};
add_filter('pre_get_posts', 'filter_search');
With that code I can only search for the reply custom post type (results with the topic custom post type don't show up).
Both are custom post types from the bbpress 2.0 plugin.
I have to do this:
$query->set('post_type', array('topic'));
in order to make the topic custom post type show up (but them I no longer get the reply custom post type to show up in the results).
Any suggestions to fix this?