How to Add Post Thumbnail to your WordPress RSS Feeds483

How-to-Add-Post-Thumbnail-to-your-WordPress-RSS-Feeds
Author: InfoBeep - December 10, 2017 | subject to copyright

If you have been using WordPress quite for a long now, you might be aware about the fact that post thumbnails of your WordPress will not show up in your RSS feeds. If you are facing the same problem, this is what you need to do. You just need to paste the code below in your functions.php file.

functionrss_post_thumbnail($content) {

global$post;

if(has_post_thumbnail($post->ID)) {

$content= '
'.get_the_post_thumbnail($post->ID) .

'
'.get_the_content();

}

return$content;

}

add_filter('the_excerpt_rss', 'rss_post_thumbnail');

add_filter('the_content_feed', 'rss_post_thumbnail');

once you paste the code, simply save it. Now you should be able to see WordPress thumbnails in your RSS.