Skip to content

Instantly share code, notes, and snippets.

@aprakasa
Created September 15, 2012 19:56
Show Gist options
  • Save aprakasa/3729495 to your computer and use it in GitHub Desktop.
Save aprakasa/3729495 to your computer and use it in GitHub Desktop.
Exclude category from feed
/** 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