Post Thumbnail on RSS Feed


Sponsored Links




Jeff Starr give nice tricks how To Added Post Tumbnail in our RSS Feed, and I will show you on today wordpress tips. This code only need tiny hack, we put some code in our functions.php and the code will be execute automatically using add_filter method.

Added Post Thumbnail on Feed - Megan Fox Jonah Hex

Added Post Thumbnail on Feed - Megan Fox Jonah Hex


So, write down Added Post Tumbnail in our RSS Feed code

function do_post_thumbnail_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', 'do_post_thumbnail_feeds');
add_filter('the_content_feed', 'do_post_thumbnail_feeds');

That’s it, we didn’t need to modify another file and the code will be injection into our RSS content or excerpt feed.

*please note Post Tumbnail featured avaliable on WordPress 2.9.x, image courtesy of Egotastic

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net


7 Responses to Post Thumbnail on RSS Feed

  1. Space Game says:

    Great trick! It’s much more appealing to have an image in the RSS.
    Btw, good idea with the celebrity images – makes me wanna come back to check out your site again. :)

  2. Neil Diamond says:

    lol, it took me awhile but i get it now. nice!

  3. Pingback: wp-popular.com » Blog Archive » How To Show Post Thumbnails in RSS Feeds # WordPress Tricks & Tips

  4. Roshith says:

    i need to show thumbnails..thanks for the info

  5. Uli says:

    Hey,

    did you notice that when you apply this hack, it forces the RSS feed to go from summary to full? In essence, it shows the thumbnail, then the full post with the larger-scale image.

    if you haven’t tried that, check it out. Now the question: how to display thumbs on excerpt-only RSS feeds?

  6. Pingback: Como agregar los Thumbnails a los RSS feeds. Wordpress En Acción

  7. Pingback: How to Exlclude some Categories on your WordPress RSS Feed | WordPress News Wire

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>