How to include Custom Posts in a Wordpress RSS Feed

// RSS Feed - include selected custom posts

function myfeed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('YOUR CUSTOM POST TYPE HERE!!!','post');
return $qv;
}
add_filter('request', 'myfeed_request');

Advertisements

How to Exclude a Category from a Wordpress RSS Feed

If you have a category with the name Videos, simply get the category ID and insert as I have done below.

/* Exclude Videos Category from RSS Feed */
function myFeedExcluder($query) {
if ($query->is_feed) {
$query->set('cat','-1109'); /* videos */
}
return $query;
}
add_filter('pre_get_posts','myFeedExcluder');