As you’ve seen before, there are many feeds that aren’t publicized in WordPress. You can use a query string format similar to the one you used for searches to get feeds of your custom content types. The post_type
parameter given should match the name of your custom content type. You can even combine content types. Here are some of the possible feed URLs for custom content types:
Feed Type |
Default URL |
Clean URL |
---|---|---|
RSS 2.0 |
/?feed=rss2&post_type=course |
/feed/?post_type=course |
Atom 1.0 |
/?feed=atom&post_type=course |
/feed/atom/?post_type=course |
RSS 0.92 |
/?feed=rss&post_type=course |
/feed/rss/?post_type=course |
RDF |
/?feed=rdf&post_type=course |
/feed/rdf/?post_type=course |
Combining content types |
/?feed=rss2&post_type=course,post,page |
/feed/?post_type=course,post,page |
john says
I can’t make combining content types work. The only post_type parameter that works for me is a single post type. Anything else seems to default to ‘post’.
Have you got multiple post types to work?
randy says
Didn’t work for me either.
breaking out post_type into multiple params (&post_type[0]=xxx&post_type[1]=yyy) did work, but only up to a point.
Global_1981 says
Thank you for this post! I could only find the feed URL for pretty permalinks on other sites. Problem is I cant seem to get it pretty permalinks working with WordPress on my local machine with MAMP so this has been a great reference!
NylandIT says
Great stuff, this has saved me many hours of work in trying (and failing) to create custom rss feed templates. So simple (but seemingly not well documented elsewhere)!
Sergio Soares says
Awesmome. Helped me a lot. Thanks
Benjamin A. Wendelboe says
I can’t get the combination of two post types to work either.. Any tricks I should know about?
“?feed=rss2&post_type=post” works great!
So does “?feed=rss2&post_type=bkr_resultat”..
But “?feed=rss2&post_type=bkr_resultat,post” doesn’t..
David Sword says
Yeah, the rss multiple post type doesn’t work for me either.. anyone figure it out?
Mark Lambert says
I couldn’t get the multiple post types to work either.
my work around was to modify the normal feed to include my normal posts and custom ones in the main feed.
added the below snippet to my functions.php
//adds custom post types to normal feed
function myfeed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('post', 'custom post one here', 'custom post two here ect');
return $qv;
}
add_filter('request', 'myfeed_request');
marius says
thanks, by reading your article I learned something new about how feeds work in WordPress 3.0 but still I wasn’t able to get an idea of what needs to be done in order to have images in a post linked with the permalink of the actual post. (same link as the title).
On my blog content consists mostly of images and it would really nice to have these images linked back.
Darko says
For anyone having troubles getting combined feeds, add post types with a plus sign, like so:
post_type=post+custom_type+page
etc.Or from a code, hook into pre_get_posts:
function my_posts($query){
if($query->is_feed()){
$query->set('post_type' => array('post', 'my_custom_post_type'));
}
return $query;
}
add_filter('pre_get_posts', 'my_posts');
One tip though. If you’re running the feed from a Page Template (like, yoursite.com/some-page/feed) then you need to do $query->parse_query( $args ); where $args would be ‘post_type’ and anything else you’d like.
Cheers.