How to get RSS feeds for custom post type in wordpress?

I want separate feed of each custom post type so that I can utilise it in mobile apps. Most of the resources on the web describe the same thing to do as:

www.your-website.com/feed/?post_type=custom_post_type_name

I tried this but it generates same feed for all post types that includes all posts and page. Am I doing something wrong? Is there any other way to do this?

Related posts

Leave a Reply

3 comments

  1. You should try to add to your functions.php the following filter:

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

    this way you are changing the post showing into feeds, from your standard post to custom post type defined in query parameters