Created
September 15, 2012 19:56
-
-
Save aprakasa/3729495 to your computer and use it in GitHub Desktop.
Exclude category from feed
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 category from feed */ | |
function excludecatfeed($query) { | |
if(is_feed()) { | |
$query->set('category__not_in','-1'); | |
return $query; | |
} | |
} | |
add_filter('pre_get_posts', 'excludecatfeed'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment