Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

From what I've found online, getting an rss feed for a custom post type is as simple as:

http://mywebsite.com/feed/?post_type=custom_type

Well I have tried it with no success as it just returns the default feed. However I can get this to work on the website just fine with

http://mywebsite.com/?post_type=custom_type

So why does it work for the html but not the rss feed? Please advise.

** EDIT **

I ended up adding this to my theme's functions.php:

function myfeed_request($qv) {
    if (isset($qv['feed']) && isset($_GET['post_type'])) {
        //$qv['post_type'] = get_post_types();
        $qv['post_type'] = explode(',', $_GET['post_type']);
    }

    return $qv;
}
add_filter('request', 'myfeed_request');
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Use this to include post types to your feed:

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

Just add it to your functions.php. This should help.

Source.

share|improve this answer
    
I modified a line of your code and viola. See my edit. –  Jackson Aug 15 '12 at 18:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.