wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Add custom post types to your sites main RSS feed

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will include the specified custom post types within your primary RSS feed.

snippet :  PHPcopy
function custom_feed_request( $vars ) {
 if (isset($vars['feed']) && !isset($vars['post_type']))
  $vars['post_type'] = array( 'post', 'site', 'plugin', 'theme', 'person' );
 return $vars;
}
add_filter( 'request', 'custom_feed_request' );
source →

Did you like this post? If so please share it with your friends. Thanks!

  • Anonymous

    That’s a great snippet Kevin! I’ve wondered at how that would be done, very nice to see how simple the code is, thanks!

    • http://wpsnipp.com Kevin Chard

      Sweet glad you like it,

  • Muslim

    How would you restrict this to a specific taxonomy linked to that custom post type, is this possible?