It was recently announced that WordPress 2.9 includes a new function to get post images called the_post_image. There is some information about the command over on WPEngineer.
Having post thumbnails is fantastic, they really liven up a post, but until recently one of the best ways to do this was to use my image resize script, TimThumb. Loads of sites use it, but now that the_post_image function has been announced it may become redundant.
Initially I thought it was great – it will make WordPress theme authors lives easier – but after mulling it over I realized there are some fundamental features missing:
- It uses WordPress statically generated thumbnails – there’s nothing dynamic – which means you are restricted to certain sizes.
- The size restrictions mean theme authors need to design with those sizes in mind, creating artificial design limitations.
- The image sizes can be altered via the WordPress admin, which means they can not be relied upon by theme devs to work consistently – again making theme design harder.
- The script only looks at the attached images and ignores those embedded in the content (which is something Mimbo Pro, Elemental, and a variety of thumbnail plugins take care of)
- It doesn’t crop the images, only resizing them, which could lead to some unpredictable results when there are very wide or tall images.
Don’t get me wrong, I think the addition is fantastic, especially for those who don’t want to spend time working out how to do it the ‘hard’ (aka custom) way, and I am sure many will use it. However from a personal point of view I will be taking the function apart to see what I can learn, but within my themes I will continue using a combination of my custom code and TimThumb.
How was it for you? Let me know on BlueSky or Mastodon
Link to this page
Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.