WordPress 2.9 – the_post_image

wordpress-logo-torn-paperIt 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:

  1. It uses WordPress statically generated thumbnails – there’s nothing dynamic – which means you are restricted to certain sizes.
  2. The size restrictions mean theme authors need to design with those sizes in mind, creating artificial design limitations.
  3. 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.
  4. 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)
  5. 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

(Please) 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.

Related Posts

01 Jul 2014

I No Longer Use TimThumb – Here’s What I do Instead

Last week there was a second exploit found in TimThumb. Thankfully it was no-where near as bad as the first one – but it raised an interesting question of whether TimThumb is even needed anymore.TimThumb was made to be useful...
01 Apr 2015

The State of WordPress Themes #wcldn

I recently spoke on a panel at WordCamp London 2015e. Lance – who used to be the Theme Team lead at WordPress.com – asked me if I wanted to speak on a panel with him at WordCamp London 2015. I’ve...
06 Jul 2009

A Brief History of TimThumb

When we were building Mimbo Pro – Darren came up with the idea of automating the image thumbnail resizing – and this was the idea that sparked the development of TimThumb.This was all part of making the theme site as...
13 Oct 2016

Lessons Learned from 20 Theme Releases on WordPress.com

In 2007 I partnered with Darren Hoyt to release Mimbo Pro, one of the earliest premium WordPress themes. In 2012 Mimbo Pro was published on wordpress.com. Last week – on October 5th 2016 to be precise – my 20th theme...
11 Oct 2009

How to Make TimThumb Work With WordPress Multisite

TimThumb is a popular image resizing script that was created for Mimbo Pro – but it’s never worked properly with WordPress MU, so I wanted to change that.The reason it doesn’t work is quite simple. Because of the way WordPress...
17 Oct 2012

WordPress Social Network Aggregation

I really like the idea of a Tumblog – and even have one on Tumblr.com – but I don’t promote it anywhere. Conceptually it’s great – but I don’t like not having control over my content.What I would really like...