Featured image in RSS

Posted in: Newspaper
Post count: 35

Hi again ! 🙂

I would like to know how I can add the featured image in the RSS ? Because for the moment I have the title and an extract of content.

Hébergeur d'image

Thanks ! 🙂

Antoine
http://www.weneedcafeine.com

Post count: 9544

Try this?
https://wordpress.org/plugins/featured-image-in-rss-feed/

or if able to edit your functions.php file
(code credit: http://brandswithfansblog.fandommarketing.com/how-to-optimize-rss-to-display-featured-blog-images/ )

function featuredtoRSS($content) {
 global $post;
 if ( has_post_thumbnail( $post->ID ) ){
 $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
 }
 return $content;
 }
 add_filter('the_excerpt_rss', 'featuredtoRSS');
 add_filter('the_content_feed', 'featuredtoRSS');
  • This reply was modified 12 years by simchris.
Post count: 35

Thanks ! 🙂 It works very well !

To display larger image, change the word ‘thumbnail‘ to ‘medium‘, ‘large‘ or ‘full‘.
😉

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.