I was developing home page for my theme directory site themeappears. I wanted to display the content thumbnails from the 3 different subdomains(premium wordpress, free blogger, free wordpress) in single page by using SimplePie(Used to read and manipulate RSS feed).
I tried to display the image thumbnails from the RSS feed using SimplePie but i found that we first need to add a bit of code to theme functions to display thumbnails in RSS feed before accessing that thumbnail using SimplePie. Here is one of my RSS feed with thumbnail images.
Below are the steps to display thumbnails in RSS feed:
Step 1 Install Get the Image WordPress Plugin.
This plugin is used to grab the images from the posts by custom fields, WP’s featured image, post attachment or from the post content.
Step 2 Copy and paste the following code to theme functions.php which can be found here: Dashboard -> Appearance -> Editor -> functions.php(Theme Functions file at right hand side). Paste the below code before the closing PHP tag (?>), if not present, just paste it at the end of the file.
function display_post_thumbnail_in_rss($rss_content) {
global $post;
if ( function_exists( 'get_the_image' ) ) {
$rss_content= '<div style="float : left;margin-right:10px;">'.get_the_image(array( 'default_image' => '', ‘image_scan’ => true, 'width' => '150', 'echo' => false ) ). '</div>'.$rss_content;
}
return $rss_content;
}
add_filter('the_content_feed', 'display_post_thumbnail_in_rss');
add_filter('the_excerpt_rss', 'display_post_thumbnail_in_rss');
Refresh your RSS feed to see the changes. You can change the width of the image in above code.
I am using Google Chrome browser with RSS extension to read the RSS feed. In Mozilla plugin is already been installed to read the RSS feeds.
Also Read: 6 High Quality Premium WordPress Showcase Themes
Thanks to www.staenzwebsolutions.com




