ShoutMeLoud – Shouters Who Inspire

≡ Menu

How to Show Thumbnail for Partial feed in WordPress

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 the_excerpt_rss() ?-->

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

<?php echo '<img src="'.get_first_image().'" alt="" />' ?>

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.

Print Friendly
  • Author Bio

  • Latest Post

Article by Harsh Agrawal

Harsh has written 1048 articles.

If you like This post, you can follow ShoutMeLoud on Twitter. Subscribe to ShoutMeLoud feed via RSS or EMAIL to receive instant updates.

{ 5 comments… add one }

  • Abhay Singh

    Hi Harsh.
    I want to display feed in sidebar with rss widget of my subdomain .
    Please Give me solution.

  • aman

    Great Info harsh , I was Really not Knowing of this feature, will sure do it..thanks…

  • Manendra

    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.

    • Harsh Agrawal

      This is the same code which I’m using on ShoutMeLoud.
      @Manendra Have you encountered any kind of error after adding these codes?

  • Rajan Balana @ DreamBloggers

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


Leave a Comment