Photo RSS Feed Display

i have a wordpress blog http://cgvector.com and I want to show Featured Images in RSS Feed. How can i do this? My feed address is: http://feeds.feedburner.com/cgvector

i have add this code but it’s not working.

function featuredtoRSS($content) {
    global $post;

    if ( has_post_thumbnail( $post->ID ) ){
    $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
    }

    return $content;
}

add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');

Related posts

Leave a Reply

2 comments

  1. function custom_feed($content) {
        return wp_get_attachment_image(get_post_thumbnail_id(), 'full') . '<br />' . $content;
    }
    add_filter('the_content_feed', 'custom_feed');
    

    This one should do the trick for you…

  2. Your code looks fine, but you can paste this code (all most same, anyways) in yourfunctions.phpthat is located inside your wp-content/themes/yourtheamefolder

    function img_to_rss($content) {
        global $post;
        if(has_post_thumbnail($post->ID)) {
            $content = '<p>'.get_the_post_thumbnail($post->ID).'</p>' . get_the_content();
        }
        return $content;
    }
    add_filter('the_excerpt_rss', 'img_to_rss');
    add_filter('the_content_feed', 'img_to_rss');
    

    Keep on mind that Feedburner caches your feed, so wait 12-24 hours for it to update before you see these changes.