Personally, I am sick and tired of the United States government meddling more and more in our lives. The movie and music industry is using our elected officials like puppets (muppets) and we are sitting idly by and letting it happen. Well, I signed the petition, and my voice will be heard next election. G.R.I.P. – Get Rid of Incumbent Politicians. If we really want to make changes, we have to get those that pander to big business out of office and let them know that we have the power to do it. After all, they are there to represent Read More…
Removing a Category From Your Feed in WordPress
Date: July 26th, 2010
Author: Joe DiFiglia
Category: Wordpress
Tags: functions.php, Wordpress
Article URL: http://computingondemand.com/?p=4130
If you run your site on WordPress and using it as a content management system, you may have realized that there are categories of posts that you don't want published on your feed. There is no easy way to do this through WordPress by default, but that doesn't mean that this isn't possible to accomplish. You can eliminate certain categories easily by editing your theme's functions.php file.
1. Edit your theme’s functions.php file
2. Paste the following code between the <?php and the ?>
// --------------------------------------------------------------------------
// Start Category Remove from Feed
// --------------------------------------------------------------------------
function myFilter($query) {
if ($query->is_feed) {
$query->set('cat','-289'); //Don't forget to change the category ID =^o^=
}
return $query;
}
// 289 = Press Releases Category
add_filter('pre_get_posts','myFilter');
// --------------------------------------------------------------------------
// End Category Remove from Feed
// --------------------------------------------------------------------------Note: These functions are not of my own creation, simply things I have found along the way. If you are the author of this function, please let me know so I can properly credit you with your work!


