Skip to content

Instantly share code, notes, and snippets.

@ovizii
Created August 4, 2013 09:42
Show Gist options
  • Select an option

  • Save ovizii/6149884 to your computer and use it in GitHub Desktop.

Select an option

Save ovizii/6149884 to your computer and use it in GitHub Desktop.
Show Post Thumbnail in feeds
// show post thumbnails in feeds
function diw_post_thumbnail_feeds($content)
{
global $post;
if(has_post_thumbnail($post->ID))
{
$content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'diw_post_thumbnail_feeds');
add_filter('the_content_feed', 'diw_post_thumbnail_feeds');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment