HR HR
asked 8 years ago

Hi, this might not be a strictly DesignWall / Focus theme question, but it might be related somehow:

We have an RSS feed from our website honestreporting.com (WordPress 4.5.2 Focus 1.08 theme):
http://feeds.feedburner.com/honestreportingRSS
This rss feed streams all our published posts.
However, recently we added a new category called “Brazil”, with posts written in portuguese. We don’t want those appearing in the RSS feed. I tried this method to exclude them in the WordPress main loop but it played havoc with the Focus front page – every post started appearing twice for some reason (even though all this code patch in functions.php was supposed to do was to EXCLUDE one category).

I also tried the plugin “Ultimate category excluder” https://wordpress.org/plugins/ultimate-category-excluder/
but in its options screen it shows a small error at the bottom: Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, resource given in /var/www/honestreporting.com/htdocs/wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 93

Is this some incompatibility with Focus?
Thanks

below doesn’t work either- tried this in functions.php:

/**
* Exclude Brazil category from RSS feed
*/

function exclude_category($query) {
$query->set(‘cat’,’-7692′);
return $query;
}
add_filter(‘pre_get_posts’,’exclude_category’);

1 Answers
DominicStaff
answered 8 years ago

We will answer your question here: https://www.designwall.com/question/exclude-a-single-category-of-posts-from-the-rss-feed/

Powered by DW Question & Answer Pro