Posted By

xavsio4 on 07/06/11


Tagged

wordpress functions


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Kurt


Wordpress Add post thumbnails to RSS feed


 / Published in: PHP
 

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

Report this snippet  

You need to login to post a comment.