Return to Snippet

Revision: 24168
at February 22, 2010 15:03 by jink


Initial Code
function insertThumbnailRSS($content) {
   global $post;
   if ( has_post_thumbnail( $post->ID ) ){
       $content = '<p>' . get_the_post_thumbnail( $post->ID, 'medium' ) . '</p>' . $content;
   }
   return $content;
}

add_filter('the_excerpt_rss', 'insertThumbnailRSS');
add_filter('the_content_feed', 'insertThumbnailRSS');

Initial URL
http://cdharrison.com/2009/12/16/the_post_thumbnail-for-rss-feeds/

Initial Description
Placed in the functions.php file.

Initial Title
Wordpress: Inject thumbnails in RSS feeds

Initial Tags
wordpress

Initial Language
PHP