that jon jackson

the one in which i explain how to add thumbnails into your wordpress rss feed

November 12th, 2009
VN:F [1.8.2_1042]

this is without a doubt, hacking the heck out of your wordpress installation, so if that is something you’re not comfortable with, please go find something else to do.

firstly, our problem is that by default, the feed that comes with wordpress does not include thumbnails, so when you auto-share your feed on facebook to keep all of your friends up to date with your goings on, there is no thumbnail attached to the article.
2009-11-12-083934

whereas when somebody shares a blogpost from say Flickr or Blogspot, they have a nice thumbnail image to accompany the article.
2009-11-12-084053This brings me to the code.
the files you will need to hack up are as follows:wp-includes/feed-rss2.php

<side note> when i was testing changes to my rss feed, i did two things.

  1. removed line 31 & 32 in “feed-rss2.php”
    <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>

  2. use a firefox plugin called "Cache Status"
    2009-11-12-084512

    this add-on lets you quickly clear the FF cache so you can refresh your rss feed and see if the edits you just made too effect.

</side note>

below is the original code from “feed-rss2.php” (This begins around like 36)

2009-11-12-084831

and this is the modified code

2009-11-12-085423

and that’s all there is to it!

wait! I hear you say. Where the crap are you getting the info for the “pft_square” variable?

Good question, and i’ll answer you now.
to create thumbnails for my posts i use a great plugin called WP Post Thumbnail.
(as of the time of this post, it is in version: 0.2 Beta 2 ) When i first began using the WP Post Thumbnail Plugin by default it named the thumbnails “pft_square”, “pft_rectangle”, and something else. so since i had already begun using that variable, i kept it.

it can be whatever you like, and i plan to write a loop that checks for several different variables, but i don’t need to right now since i know how it works, so suck on that.

anyway, back to the thumbnail creation for the post.

then i followed these steps:

2009-11-12-085518

2009-11-12-0900282009-11-12-090501then you’re left with this:

2009-11-12-090529

which then gives you a new custom field (once you publish the post) of:

2009-11-12-090638

then your rss feed will include that thumbnail.

2009-11-12-090754

and that as they say, is that.

other helpful Info:

How to Format Images for Feed Readers

How To Insert Custom Image Thumbnail on Facebook Link Sharing

5 tips for optimizing your brands (on facebook)

VN:F [1.8.2_1042]
Rating: 0 (from 0 votes)

you might also like...

replace “Protected:” text from a password Protected WordPress post with an image HOW TO: windows live writer posting to a self hosted wordpress blog switching an image using the featured content gallery plugin for wordpress embedding a private scribd document into wordpress 2.9.1 how to for Teleos Christian – cformsII for wordpress
brought to you by YARPP.

Leave a Reply

that jon jackson, a freelance designer of graphics. and screenprinter of t-shirts.
918.970.0001 | Copyright © that jon jackson.