comment 0

Placing thumbnails in your RSS feed: WordPress Hack

My wordpress RSS feed has always been a bit dull without the accompanying pictures I scour flickr for. However, today there is promise as I stumbled across a post by the wordpress geniuses at catswhocode, there was a wordpress hack to include pictures in your RSS feed, and all it requires is to post the following code into your themes functions.php file.

function cwc_rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = ‘

‘ . get_the_post_thumbnail($post->ID) .

‘ . get_the_content();
}

return $content;
}
add_filter(‘the_excerpt_rss’, ‘cwc_rss_post_thumbnail’);
add_filter(‘the_content_feed’, ‘cwc_rss_post_thumbnail’);

I’m just trying this out to see if it works, for a list of other hacks and great wordpress content, head on over to catswhocode, source code via http://snipplr.com/view.php?codeview&id=56180

 

*Latest update: the hack didn’t work, and I had to delete it because it kept giving me errors. Will investigate further and update when I can.

#YourComment