Skip to content

Instantly share code, notes, and snippets.

@bueltge

bueltge/gist:1218587

Created Sep 15, 2011
Embed
What would you like to do?
Add WordPress post thumbnail to feed
// show post thumbnails in feeds
function fb_post_thumbnail_2_feeds( $content ) {
if ( has_post_thumbnail( get_the_ID() ) )
$content = '<div>' . get_the_post_thumbnail( get_the_ID() ) . '</div>' . $content;
return $content;
}
add_filter( 'the_excerpt_rss', 'fb_post_thumbnail_2_feeds' );
add_filter( 'the_content_feed', 'fb_post_thumbnail_2_feeds' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment