Warning: Undefined variable $platform in /var/www/lineshjose.com/wp-content/themes/linesh/inc/lib/php-browser-detection.php on line 126
How to: Add Post Thumbnails to WordPress RSS Feed - LineshJose.com
How to: Add Post Thumbnails to WordPress RSS Feed

How to: Add Post Thumbnails to WordPress RSS Feed

We used to see the thumbnail images in blog posts. But, I think you didn’t know how to add thumb images in RSS feed posts. In WordPress, you can show your thumb images in RSS feed posts. It is very easy. Simply copy and paste this code block to your WordPress theme’s function.php file.

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