WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Feed for Custom Post Types (11 posts)

  1. moshthepitt
    Member
    Posted 3 years ago #

    I'm thinking about playing with custom post types when wordpress 3.0 is out

    I was wondering: are custom post types included in the RSS feed, or can one create an RSS feed for them?

  2. MichaelH
    Member
    Posted 3 years ago #

    :Q. Is there a way to get a feed that includes a custom post type
    ; Sure, use something like: http://example.com/feed/?post_type=yourposttype Also see: http://core.trac.wordpress.org/ticket/12943

  3. moshthepitt
    Member
    Posted 3 years ago #

    Thanks!

  4. rikoona
    Member
    Posted 3 years ago #

    Hello,

    Great Information.. thanks

    I manage to have a category for each post in my custom post type.

    I also manage the display to filter it with each category on the page.

    Is it possible to display all post in a post type with a specific category on a RSS Feed?...

  5. rikoona
    Member
    Posted 3 years ago #

    Got it.....

    Used this to include all post from all post types:

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

    Taken from: http://core.trac.wordpress.org/ticket/12943

    Pheeew...

  6. lukeshumard
    Member
    Posted 3 years ago #

    This didn't work for me for whatever reason.

    Here is what I pasted in my function.php file in my theme.

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

    Does this need to go in the RSS Include Pages plugin?

    I've never worked with feeds or RSS files before, so any help in getting this going is greatly appreciated. Thanks!

  7. romanczar
    Member
    Posted 3 years ago #

    Hm... doesn't work for me. Still the feed only contains the post_type "posts", but no custom ones. I also tried to use an array instead of get_post_types(), but this didn't help either...

  8. rikoona
    Member
    Posted 3 years ago #

    Hey There,

    If this solution

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

    won't work for you, then you can use a helper created by Matt Wiebe, works like a charm, it includes rss, pagination for custom post types etc.

    you can get it
    here

    and put it somewhere on the theme directory and include it on the functions.php

    instead of register_post_type, use sd_register_post_type to register a custom post type,

    cheers,

  9. donalyza
    Member
    Posted 3 years ago #

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

    I use this code and it worked! I have one issue, I have several post type and I want to exclude one of my post type. I appreciate your help.

    Thanks

  10. Syed Balkhi
    Member
    Posted 3 years ago #

  11. marlonlamancio
    Member
    Posted 3 years ago #

    None of that include the custom post types in my main feed rss. Still the feed only contains the post_type "posts", but no custom ones.

    Please anyone help me. I'll be very greatful!

Topic Closed

This topic has been closed to new replies.

About this Topic