Add the Thumbnail To Your RSS Feed
2 posts
• Page 1 of 1
Add the Thumbnail To Your RSS Feed
Hello,
To follow an ask from Shanta. I'll give you the hack to add your custom field thumbnail to the RSS Feed.
It's quite easy, In your ImageRiver theme directory find the functions.php file and add the following code at the beginning after <?php markup
If you want add the large thumbnail you can modify in the code
get_post_meta($post->ID,'screenshot', true) by get_post_meta($post->ID,'image', true)
You can also modify the size of the image (height and width): h=180&w=290
Best Regards,
To follow an ask from Shanta. I'll give you the hack to add your custom field thumbnail to the RSS Feed.
It's quite easy, In your ImageRiver theme directory find the functions.php file and add the following code at the beginning after <?php markup
- Code: Select all
function kd_image_for_feeds( $content ) {
global $post, $id, $wpdb;
if(get_post_meta($post->ID,'screenshot', true) <> '') {
$content = '<p>
<img src="'.get_bloginfo('template_directory').'/thumb.php?src='.get_post_meta($post->ID,'screenshot', true).'&h=180&w=290&zc=1&q=85" alt="" class="center"/>
</p>'.$content;
return $content;
} // End if image
else {
return $content;
}
}
add_filter('the_content_rss', 'kd_image_for_feeds');
add_filter('the_excerpt_rss', 'kd_image_for_feeds');
If you want add the large thumbnail you can modify in the code
get_post_meta($post->ID,'screenshot', true) by get_post_meta($post->ID,'image', true)
You can also modify the size of the image (height and width): h=180&w=290
Best Regards,
Kadom Admin
-

Kadom - Site Admin
- Posts: 22
- Joined: 23 Mar 2009, 12:05
Re: Add the Thumbnail To Your RSS Feed
Works well.
Cheers
Cheers
- shansta
- Posts: 10
- Joined: 13 Dec 2009, 10:05
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests

