WordPress 2.9 introduced get_the_post_thumbnail() allow display a thumbnail in posts. But what about displaying post thumbnails in RSS Feeds? Just reads this post to know how to do.
Simply paste the following code in you functions.php fil. the post thumbnail should be visible once you saved the file.
Simply paste the following code in you functions.php fil. 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');
If you enjoyed this article, please consider sharing it!