Introduced in WordPress 3.0, get_the_post_thumbnail() allow you to display a thumbnail in your posts. But what about displaying post thumbnails in RSS feeds? Just read this recipe to know how to do.
Simply paste the following code in your functions.php file. The post thumbnail should be visible once you saved the file.
function diw_post_thumbnail_feeds($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'diw_post_thumbnail_feeds');
add_filter('the_content_feed', 'diw_post_thumbnail_feeds');
Thanks to Jeff Starr for this great tip!
Did you enjoy this article? Give us some link love, and don't forget to bookmark this page on Delicious.
Notes :
Join us and read the Guidelines to submit your guest posts.
Subscribe free updates via: RSS Feed | Email | Twitter
What Next?
- Tweet this Post
- Digg this Article
- Stumble this article
- Technorati this post
- Bookmark on del.icio.us






{ 7 comments… read them below or add one }
Thanks a lot for sharing this bro. Does this show in feedburner feeds too?
Hi friend. This tips not show in feedburner feeds
Oh that is a shame. I have Feedburner and would love for something to show thumbnails.
Yea, that would be awesome to have thumbnails on feedburner. To bad, anyway nice tip though.
@Michael Yes too bad because this tips can display thumbnails on feedburner
Thank you for this great tip, I was looking to thumb to the my RSS feed, makes it more attractive
Hi Marty.
Glad you like it.