Add post thumbnails to WordPress RSS feed

rss-thumbnail-wordpress

Feedburner is the most used RSS subscriber service for bloggers. If you want to display to your readers just a thumbnail of the post, instead of tweaking your theme add e few lines on the functions.php file.

Open the functions.php file on your theme, and place this code:

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

 

If you enjoyed this WordPress hack, subscribe to our feed for more tips and tricks!

Share your love

2 Comments

  1. is this working for RSS reader wordpress widget…?? i looking for way to insert thumbnails image in rss widget..anyone..?

Leave a Reply

Your email address will not be published. Required fields are marked *