Add Post Thumbnail To WordPress RSS Feeds

As per default WordPress doesn’t show your post image into the post RSS feed. I just found out this a couple while ago when i try to use Feedly apps from my mobile to subscribe to this blog. And i realize that i don’t have my post feature image show up. And in fact to show the post feature image to the RSS feed is really easy (if you are a web developer).

All you need to do is add this snippet code to your themes functions.php:

function add_featured_image_to_feed($content) {
 global $post;
 if ( has_post_thumbnail( $post->ID ) ){
 $content = '' . get_the_post_thumbnail( $post->ID ) . '' . $content;
 }
 return $content;
}

add_filter('the_excerpt_rss', 'add_featured_image_to_feed', 1000, 1);
add_filter('the_content_feed', 'add_featured_image_to_feed', 1000, 1);

If you trouble to add it to your WordPress themes, please let me know from the comment box below. Thanks.

Give me your feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.