Wordpress Add post thumbnails to RSS feed


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.