0

So I'm using feedburner for my feeds and using that option to only show excerpt/summary of the blog posts, the only problem is that with this option and not the full posts into the feed, it won't show me the images, the featured images of that post.

Is there a way I can do that?

Thank you

1 Answers1

0

You can use the following sample code in the functions.php to show featured image in the excerpt feed

//Function to add featured image in RSS feeds
function featured_image_in_rss($content){
    global $post;
    if (has_post_thumbnail($post->ID)){
        $content = '<div class="featured_image_post_rss">' . get_the_post_thumbnail($post->ID, 'medium', array('style' => 'margin:10px; text-align: center;')) . '</div>' . $content;
    }
    return $content;
}

//Add the filter for RSS feeds Excerpt
add_filter('the_excerpt_rss', 'featured_image_in_rss');

Also if you want to add featured image to the content feed, just add the following filter in addition with the above code.

//Add the filter for RSS feed content
add_filter('the_content_feed', 'featured_image_in_rss');
Akhilesh
  • 1,064
  • 15
  • 28
  • Thank you for your answer, but will this get pushed into the feed from feedburner ? as you can see I already have pictures in my feed from the theme I'm using http://bucatepealese.ro/feed but if I use feedburner with the excerpt option, it won't show any pictures. – user3190197 Feb 19 '14 at 10:53