Permalink
Browse files

Include a posts featured image in RSS feeds.

  • Loading branch information...
1 parent a5591e9 commit 8171ae9c6cc0263c40482089da07da7987e9c642 @tlongren tlongren committed Jul 20, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 functions.php
View
@@ -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 = '<p>' . get_the_post_thumbnail($post->ID) .
+ '</p>' . get_the_content();
+ }
+
+ return $content;
+}
+
// Setup featured posts slider
function html5press_featured_posts() { ?>
<div id="slider-wrapper">

0 comments on commit 8171ae9

Please sign in to comment.