Created
September 15, 2011 05:03
-
-
Save bueltge/1218587 to your computer and use it in GitHub Desktop.
Add WordPress post thumbnail to feed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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