Skip to content

Instantly share code, notes, and snippets.

@asecondwill
Created February 24, 2015 23:36
Show Gist options
  • Save asecondwill/002e9f871202ea5d2596 to your computer and use it in GitHub Desktop.
Save asecondwill/002e9f871202ea5d2596 to your computer and use it in GitHub Desktop.
function GetCertainPostTypes($query) {
if ($query->is_search) {
$query->set('post_type',array('person'));
}
return $query;
}
add_filter('pre_get_posts','GetCertainPostTypes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment