Created
April 5, 2019 13:23
-
-
Save chered/a85c832934c9e027a6c4b2a761b3f2a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function searchfilter($query) { | |
if ($query->is_search && !is_admin() ) { | |
$query->set('post_type',array('post','page')); | |
} | |
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