Themes and Mods

Find Wordpress Themes, Plugins, Joomla Templates, Extensions

Best WP Themes Club

How to Add WordPress Custom Post Types to RSS Feed

WordPress Custom Post Types are very useful when you plan to build a CMS type of website using WordPress. If you have used “register_post_type” function to create your own post type then you might need to add your posts to RSS feed.

Here is how you can add your custom post type to rss feed.

//Add a function
function myfeed_request($ptr) {
	if (isset($ptr['feed']) && !isset($ptr['post_type']))
		$ptr['post_type'] = array('post', 'YOUR_CUSTOM_POST_TYPE_1', 'YOUR_CUSTOM_POST_TYPE_2', , 'YOUR_CUSTOM_POST_TYPE_3'); //You can add more custom post types as you need.
	return $ptr;
}
//Add the hook
add_filter('request', 'myfeed_request');

Good Luck!

Please don’t forget to post a comment if this post is helpful to you.

More WordPress Tips here

Tagged with: ,


Please let us know your comments and suggestions:

Comments are closed.
Note: All the templates and extensions listed in this site are from their respective developers and all support requests should be sent directly to the developers. We do not provide support for any of the templates or extensions listed in this site. We just make some revenue if you purchase any of the product through the link from our site.