Posted By

jink on 02/22/10


Tagged

rss wordpress thumbnail


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

themolitor
maxvee8


Wordpress: Inject thumbnails in RSS feeds


 / Published in: PHP
 

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

Placed in the functions.php file.

  1. function insertThumbnailRSS($content) {
  2. global $post;
  3. if ( has_post_thumbnail( $post->ID ) ){
  4. $content = '<p>' . get_the_post_thumbnail( $post->ID, 'medium' ) . '</p>' . $content;
  5. }
  6. return $content;
  7. }
  8.  
  9. add_filter('the_excerpt_rss', 'insertThumbnailRSS');
  10. add_filter('the_content_feed', 'insertThumbnailRSS');

Report this snippet  

You need to login to post a comment.