Posted By

christophr on 04/16/12


Tagged


Versions (?)

add thumbnails to rss feeds


 / Published in: PHP
 

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

Report this snippet  

You need to login to post a comment.