In this tutorial you will learn how to add post thumbnails to your WordPress RSS feed.
Even though featured image is enabled for your WordPress by default thumbnails in the RSS feed is disabled state.
Don’t worry I have a solution for you.
All you need to do is adding the following code to your themes functions.php file.
function rss_post_thumbnail($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', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');
Below is the step by step procedure to add the enable thumbnails in RSS feed.
For more related content follow us on Twitter, Telegram, Facebook.