Created
December 24, 2015 14:54
-
-
Save jimmyk69/ecce30c34aa2c9575cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// exclude pages from search | |
function SearchFilter($query) { | |
if ($query->is_search) { | |
$query->set('post_type', 'post'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','SearchFilter'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment