Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPressで特定カテゴリをRSSフィードに表示させない設定
function RSSCategoryFilter($query) {
if ($query->is_feed) {
$query->set('cat', '-XXX'); // XXXは除外したいカテゴリID
}
return $query;
}
add_filter('pre_get_posts', 'RSSCategoryFilter');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.