How to Show Thumbnail for Partial feed in WordPress

In the past I talked a lot about Partial feed (Summery feed) and why you should have Partial feed. As it is, if you have read why images are important for blog, you would understand that it helps in increasing CTR. Though when you convert your complete feed into Partial feed, you will notice that Feedburner, Google reader, Facebook and other services won’t show any image for post. Specially after implementing partial feed, I noticed that traffic from Facebook went down and it’s because of less CTR due to no thumbnail.

This post is for all those who have implemented Partial feed (Summery feed) and want to show image in the feed. You need to have knowledge of FTP and basic copying-pasting code. If not, you can always take help of our WordPress services. Getting back to tutorial, all we need to do is edit two files from wp-includes folder (feed-rss2.php and functions.php).

Showing Thumbnail on Facebook and Other RSS readers: WordPress

Login to your FTP account and browse to wp-includes folder and download and make a back of above mentioned files in a folder. Now lets start with editing of these files to show thumbnail.


Editing feed-RSS2 file:

Click on open and edit feed-rss2.php file and search for line:

[php]<?php the_excerpt_rss() ?–>[/php]

And add this line before above code and after [CDATA[

[php]<?php echo ‘<img src="’.get_first_image().’" alt="" />’ ?>[/php]

Save the file and upload it back to wp-includes folder.

Editing WordPress functions.php:

Now open Functions.php from Wp-includes folder and search for this line: “Removes site option by name”

And add this code as shown the image:

function get_first_image() {
global $post, $posts;
$first_img = ”;
$output = preg_match_all(‘/<img.+src=[\’"]([^\’"]+)[\’"].*>/i’, $post->
post_content, $matches);
$first_img = $matches [1] [0];
//Defines a default image
$first_img ="";
return $first_img;

Don’t forget to replace the with your default image link. Save and upload the file back.
Now it will take almost 24 hours for Feed-burner to update your feed or if you use direct feed on Facebook, you will see thumbnail from next published post.

This also makes your feed looks good else after implementing Partial feed you might have noticed less traffic from Feeds or Facebook (Atleast true in my case).

Do let me know if you find any issue implementing thumbnail for partial feed and I will try to answer asap. You can also use our Facebook fan page to ask questions.

Subscribe on Youtube

Article By
Harsh Agrawal is a blog scientist and a passionate blogger. He is blogging since 2008 & writes about Blogging, SEO, Make money online & tech. His blog, ShoutMeLoud receives 1 million Pageviews/month and have over 700K subscribers.


COMMENTs ( 5 )

  1. Manendra says

    Since from a couple of days i am wondering Y my images are not displaying in my FB RSS and thank Q for the tutorial i made the necessary changes as you mentioned above hope i’ll see the thumbnails in coming 24Hrs.

  2. Rajan Balana @ DreamBloggers says

    Hey Harsh, The code shown in the image is not matching with the code shown in the code