bhubbard
4/15/2015 - 7:06 PM

rss-feed-images.php

<?php
################################################################################
// Featured Image for RSS FEEDS
################################################################################
function clientname_post_thumbnail_rss($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '' . get_the_post_thumbnail( $post->ID, 'rss-image', array( 'style' => 'float:left; margin-right:10px; height: 150px; width: 300px; border: 2px solid #e5e5e5' ) ) . '' . $content;
}
return $content;
}
/**
* @author Brad Dalton
* @example http://wpsites.net/web-design/add-featured-image-thumbnail-from-post-to-rss-feed/
*/
add_filter('the_content_feed', 'clientname_post_thumbnail_rss');
add_filter('the_excerpt_rss', 'clientname_post_thumbnail_rss');