WordPress.org

Ready to get started?Download WordPress

Forums

Update (not show!) a feed after publish a custom post type (3 posts)

  1. Alberto Ziveri
    Member
    Posted 3 years ago #

    Hi,
    surfing in the web I found this useful snippet to show custom post types in the feed and in the homepage. But unfortunately when I publish a new custom post type it doesn't update the feed and it update it only after I publish a normal post, and then I can see both the post both the custom post type I previously published.
    So what have I to edit in this script??

    add_filter( 'pre_get_posts', 'my_get_posts' );
    function my_get_posts( $query ) {
    
    	if ( ( is_home() && false == $query->query_vars['suppress_filters'] ) || is_feed() )
    		$query->set( 'post_type', array( 'post', 'custom_post') );
    
    	return $query;
    }

    Thanks all!

  2. Alberto Ziveri
    Member
    Posted 3 years ago #

    Could someone help me please?

  3. yotsugi
    Member
    Posted 3 years ago #

    I have same problem.

    But, if you use FeedBurner, you can manually "refresh" your feed.
    Login to your FeedBurner account, then click "Edit Feed Details…" at the right top. You don't have to do anything, just click "Save Feed Details".

    Voila! Your custom post type feed now appear in the main feed!

    Wonder if this is WordPress bug??

Topic Closed

This topic has been closed to new replies.

About this Topic