large shade tree

Navigation

Information

Recent Posts

Shade Tree Sites |Building Better Websites

How to Include Custom Post Types in RSS Feed

Include below in your functions.php file to add custom post types to you RSS feed:

function myfeed_request($qv) {
if (isset($qv['feed']))
$qv['post_type'] = get_post_types();
return $qv;
}
add_filter('request', 'myfeed_request');

To add specific custom post types include this:

function myfeed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('post', 'products', 'reviews', 'movies');
return $qv;
}
add_filter('request', 'myfeed_request');

 

Source: WPBeginner