Skip to content

Instantly share code, notes, and snippets.

@kachi
Created March 13, 2012 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kachi/2031704 to your computer and use it in GitHub Desktop.
Save kachi/2031704 to your computer and use it in GitHub Desktop.
<?php
function post_thumbnail_in_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', 'post_thumbnail_in_feeds');
add_filter('the_content_feed', 'post_thumbnail_in_feeds');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment