Created
September 28, 2015 18:07
-
-
Save anonymous/cd0d7d8d3bc49ec88f04 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
function search_filter($query) { | |
if(!is_admin()) { | |
if($query->is_main_query() || is_archive()) { | |
$query->set('post_type', 'post'); | |
$query->set('cat', '-1307,-1'); | |
} | |
} | |
} | |
return $query; | |
} | |
add_action('pre_get_posts', 'search_filter'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment