At this following staging URL: http://goo.gl/FFVfRA - We have a sage theme that for some reason won’t allow for searching of CPTs. We tried a number of things, including adding multiple advanced searching plugins but nothing seems to allow for the searching of CPT content.
For example, a search for “Concussions” should bring up a search results page that references the most recent blog post (which is currently being pulled from a CPT for other reasons I won’t get in to).
Anyone have issues with this and what can we do to resolve this?
Are you able to find the CPT content without a plugin? Without ruling out issues with those plugins it’s difficult to determine whether this is Roots related, plugin related, or just a general WP support issue.
If i’m understanding correctly, you’re asking if we have the CPT “query_var” set to “true”? We are currently using the CPT UI plugin to make the CPT. Within that plugin, the query_var option is set to true:
Thanks guys! This helped point me in the right direction on this one. It appears that a developer, somewhere along the way, added this to the functions.php file:
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
That might explain it - All fixed now. Thanks guys, definitely wasn’t a Sage specific issue on this one.