How to Add WordPress Custom Post Types to RSS Feed
Category: Blog
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 functionmyfeed_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.
Tagged with: wordpress rss feed tips , wordpress tips
Please let us know your comments and suggestions: