Grow Your Business Online – Web sites to boost your business
The owner of FightHounds.com needed some updates to WordPress site and his original developer was busy, so he posted his request on boards.ie Software & Web Development forum. The owner didn’t understand my technical reply about post-thumbnail support and asked for someone to make the changes. I contacted him and got to work.
I ‘borrowed’ some code from the WordPress Popular Posts plugin to extract the url of the first image in a post. I used timthumb to resize the image to a thumbnail. This created thumbnails for existing posts.
As the site is running WordPress 2.9.2, which supports post thumbnails I decided to enable post-thumbnails in the theme and use post thumbnails if they were set for a post. This allows the owner to set a specific post thumbnail for new posts. The current version of timthumb only works for images on the current web site so I got the beta version that will retrieve images from other sites (as FightHounds.com uses images from other sites – tut tut!), though I had to make a single line hack to allow retriving from any site (it defaults to flickr, picasa, blogger.com and wordpress.com).