WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Feed for Custom Post Types

[Resolved] Feed for Custom Post Types

  • 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?

Viewing 10 replies - 1 through 10 (of 10 total)
  • :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

    Thanks!

    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?…

    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…

    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!

    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…

    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,

    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

    You can do it like shown in this tutorial:

    How to Add Custom Post Types to Your Main WordPress RSS Feed

    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!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Feed for Custom Post Types’ is closed to new replies.
Skip to toolbar