PHP – WordPress – Add Thumbnails to RSS Feeds

The given PHP example helps you to add the thumbnails to RSS feed into WordPress. 

Code Example:
<?php
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');
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Reply

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

*