poisonborz
Member
Posted 8 months ago #
I'm just transitioning to 2.0, but I can't seem to get search working
- nothing shows up in the results. Search works for normal posts and
any custom post type I create with a different plug-in, but not in
MF2.
(and, ahem, of course "exclude from search" is not checked in the post
type options)
What could be the problem?
Thanks
poisonborz
Member
Posted 8 months ago #
I eventually solved this by applying a search filter over the original
query:
function searchfilter( $query ) {
if ( isset( $query['s'] ) ) {
$query['post_type'] = array('posttype1','posttype1');
}
return $query;
}
add_filter('request', 'searchfilter', 1);
I wonder why it won't work without it though...