Stephanie Leary

Writer and WordPress consultant

  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Fascism Watch (2016-17)
    • Content Modeling for WordPress series
    • WordPress Hidden Gems series
  • Work
    • Portfolio
    • Services
    • WordPress Plugins
    • WordPress Themes
    • Presentations and Interviews
    • on GitHub →
  • About
    • Press Kit
  • Contact
    • Mailing List

Feeds for custom content types in WordPress 3.0

June 18, 2010 Stephanie Leary 10 Comments

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
(default)

/?feed=rss2&post_type=course /feed/?post_type=course
/feed/rss2/?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

WordPress Content, custom post types, feeds, Notifications

Comments

  1. john says

    July 18, 2010 at 5:17 pm

    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?

    Reply
    • randy says

      September 11, 2015 at 1:30 pm

      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.

      Reply
  2. Global_1981 says

    July 25, 2010 at 6:29 am

    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!

    Reply
  3. NylandIT says

    July 29, 2010 at 4:15 am

    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)!

    Reply
  4. Sergio Soares says

    August 4, 2010 at 8:15 pm

    Awesmome. Helped me a lot. Thanks

    Reply
  5. Benjamin A. Wendelboe says

    August 11, 2010 at 11:41 am

    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..

    Reply
  6. David Sword says

    September 1, 2010 at 3:41 am

    Yeah, the rss multiple post type doesn’t work for me either.. anyone figure it out?

    Reply
  7. Mark Lambert says

    October 25, 2010 at 8:44 am

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

    Reply
  8. marius says

    August 26, 2011 at 8:57 am

    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.

    Reply
  9. Darko says

    August 5, 2012 at 9:53 am

    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.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Facebook
  • Github
  • Google+
  • Pinterest
  • Tumblr
  • Twitter

Fascism Watch

The Fascism Watch is a daily(ish) news roundup. View all the previous Fascism Watch posts »

Latest WordPress Book

Content Strategy for WordPress

A short book for content strategists and managers on implementing a complete content strategy in WordPress: evaluation, analysis, content modeling, editing and workflows, and long-term planning and maintenance.

Read the sample chapter

Kindle Nook iBooks Kobo Smashwords

WordPress for Web Developers

WordPress for Web Developers (9781430258667)

This is a book for professional web designers and developers who already know HTML and CSS, and want to learn to build sites with WordPress. The book begins with a detailed tour of the administration screens and settings, then digs into server-side topics like performance and security. The second half of the book is devoted to development: learning to build WordPress themes and plugins.

This is the second, much-revised and updated edition of Beginning WordPress 3, with a more accurate title. Everything’s been updated for WordPress 3.6.

WordPress for Web Developers is out now. See what's inside...

The best WordPress features you’ve never noticed

  • WordPress Hidden Gems: Screen Options
  • WordPress Hidden Gems: Bulk Edit
  • WordPress Hidden Gems: Private Status
  • WordPress Hidden Gems: Dashboard Feed Readers
  • WordPress Hidden Gems: Options.php

Content Modeling for WordPress series

  • Content modeling for WordPress, part 1: analyze content
  • Content modeling for WordPress, part 2: functional and organizational requirements
  • Content modeling for WordPress, part 3: a sample content model

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Copyright © 2018 Stephanie Leary