Add Post Thumbnails to WordPress RSS Feed

Add Post Thumbnails to WordPress RSS Feed

Did you know that if you implement post thumbnails in your theme, they will not be automatically included in your RSS?

You need to add a little function to get them to show up in your feed. It’s not difficult. Just copy and paste this into your functions.php file.

function rss_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');

Source: David Redfern’s Post a Week

Free Video Why 100 is NOT a Perfect Google PageSpeed Score (*5 Min Watch) Learn how to use Google PageSpeed Insights to set realistic goals, improve site speed, and why aiming for a perfect 100 is the WRONG goal.
Tags: