4 02 2011
Post Thumbnails in WordPress 3.0.4
In this follow-on post, I will show you to get post thumbnails showing up next to posts in a stock install of wordpress 3.0.4 with a few minor improvements.
First, Read through the original article on setting up post thumbnails in twenty ten. These instructions still work in wordpress 3.0.4.
The only thing you have to watch out is the names of the thumbnails, for example in the article I change the default thumbnail size and then I add an additional thumbnail size called “single”. In the html output, wordpress attaches different class names to different thumbnail sizes so you can have different css rules. In my case the thumbnail css rules will be img.attachment-post-thumbnail and img.attachment-single-post-thumbnail. I use these rules to float the images to the left of my post text.
You should also use has_post_thumbnail to check that a post has a thumbnail as well.
I have attached my basic theme below that showcases the thumbnail setup, simply unzip it in your wordpress 3 themes directory to see post thumbnails in action.
And here is what it looks like: