Last active
August 29, 2015 14:06
-
-
Save celsofabri/014abedf9e1f5a91d233 to your computer and use it in GitHub Desktop.
Exclude "pages" in Search of Wordpress / Excluindo "pages" da busca do WordPress
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
<?php | |
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