Skip to content

Instantly share code, notes, and snippets.

@asecondwill
Created February 24, 2015 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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