hide categories from rss feed
-
I saw this post: http://wordpress.org/support/topic/wp-31-breaks-rss-customization-via-exclude_category?replies=14
and tried implementing the listed code to hide categories:blockquote
function exclude_category($query) {
if ( $query->is_feed && $query->query_vars[‘all’] != ‘true’ ) {
$query->set(‘category__not_in’, array(473,281));
}
return $query;
}
add_filter(‘pre_get_posts’, ‘exclude_category’);
blockquotebut it didn’t work. The code showed up on my homepage… I’m using a child theme and the functions.php file for that theme is empty. Could that be the case or is that code incorrect? Or should I put the code in the main theme’s file? If so, where? Then I guess I would have to redo it every time I update.
thanks
The topic ‘hide categories from rss feed’ is closed to new replies.