ControlledChaos
5/7/2015 - 9:31 AM

Post Thumbnails in RSS Feed

Post Thumbnails in RSS Feed

<?php

function ccd_add_featured_image_to_feed( $content ) {
  global $post;
    if ( has_post_thumbnail( $post->ID ) ){
    $content = '' . get_the_post_thumbnail( $post->ID ) . '' . $content;
  }
 return $content;
}
 
add_filter( 'the_excerpt_rss', 'ccd_add_featured_image_to_feed', 1000, 1 );
add_filter( 'the_content_feed', 'ccd_add_featured_image_to_feed', 1000, 1 );

?>

Post Thumbnails in RSS Feed

WordPress Snippet