Posted By

mediamilan on 08/13/10


Tagged

rss post wordpress thumbnails


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

manavecplan
techdetours
athanassiadis


Wordpress: Display post thumbnails in RSS Feed


 / Published in: PHP
 

URL: www.mediamilan.com

By default wordpress does not include post thumbnails in RSS Feeds. Enable in by add this code the functions.php located inside your themes folder.

  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.