Search by type posts and taxonomy
Question
I want that my search page give results of posts (that i want that show) and taxonomy
The code to get just two type of posts:
function searchfilter($query) {
if ($query->is_search && !is_admin() ) {
$query->set('post_type',array('lesson','series'));
}
return $query;
}
add_filter('pre_get_posts','searchfilter');
I want it to look for taxonomy too
Thanks
0
custom-taxonomy, filters, pre-get-posts, search
6 years
2017-12-18T11:52:27-05:00
2017-12-18T11:52:27-05:00 0 Answers
89 views
0
Leave an answer