Can’t Display Featured Image in RSS Feed

By default, RSS won’t display. You have to use RSS2. However this will help you. Paste it in your functions.php:

function insert_thumbnail_into_feed() {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
    // replace thumbnail with yours
    $content="<p>" .get_the_post_thumbnail( $post->ID, 'thumbnail' ) .'</p>';
}

// get post content and replace feed content with
// you can also limit/filter the content to exclude shortcodes and HTML code etc.
$content .= '<p>' .get_the_content() .'</p>';

return $content;
}
add_filter( 'the_excerpt_rss', 'insert_thumbnail_into_feed' );
add_filter( 'the_content_feed', 'insert_thumbnail_into_feed' );

Hope it helps.

Leave a Comment