Add post thumbnails to WordPress RSS feed

ads

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!

ads
Get our hottest stories to your inbox.
Check your inbox for a confirmation email.

Have something to add to this story? Share it in the comments.

Have something to add to this story? Share it in the comments.

Leave a Reply

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