Home / admin / Add custom post types to your sites main RSS feed
  • How to Add custom post types to your sites main RSS feed

    add-custom-post-types-to-your-sites-main-rss-feed

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

    wordpress snippet : PHP

    <>
    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' );
    

    ( WordPress codex functions, hooks, in this snippet. )

    request, add_filter,
  • 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?