From 8171ae9c6cc0263c40482089da07da7987e9c642 Mon Sep 17 00:00:00 2001 From: Tyler Longren Date: Wed, 20 Jul 2011 16:19:19 -0500 Subject: [PATCH] Include a posts featured image in RSS feeds. --- functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/functions.php b/functions.php index 0626bb6..d0e2492 100644 --- a/functions.php +++ b/functions.php @@ -220,6 +220,19 @@ function html5press_link_filter($link, $post) { return $link; } +// Add featured post images to RSS feed +add_filter('the_excerpt_rss', 'html5press_feed_thumbnail'); +add_filter('the_content_feed', 'html5press_feed_thumbnail'); +function html5press_feed_thumbnail($content) { + global $post; + if(has_post_thumbnail($post->ID)) { + $content = '

' . get_the_post_thumbnail($post->ID) . + '

' . get_the_content(); + } + + return $content; +} + // Setup featured posts slider function html5press_featured_posts() { ?>