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.

Was it good/ useful/ a load of old rubbish? Let me know on Mastodon, or BlueSky (or Twitter X if you must).

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.

WordPress News

The latest WordPress updates from the WPBriefs Podcast.

Related Posts

19 Apr 2011

Simple WordPress Post Thumbnails with Regular Expressions

These days everyone with a blog understands the importance of thumbnail images. Three years ago it was common place to have exclusively text, but now a nice image is a requirement. As such the process of implementing the image needs...
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...
25 Jul 2007

WordPress Tips and Tricks – Custom Login Page

It’s cool to have the WordPress login page customized to fit your own website branding. This is even more significant for multi author blogs, or sites you have set up for clients as it adds that little extra something.Since writing...
05 Jul 2016

Dogfooding a New WordPress Design

Eating your own dog food, also called dogfooding, is a slang term used to reference a scenario in which a company uses its own product to test and promote the product.Wikipedia – DogfoodingThis is another thing on the long list...
27 May 2013

WordPress: 10 Years Young, What Does The Future Hold?

WordPress is now 10 years old. I started using wordpress 9 years ago – which means I joined the WordPress community early on. The reason I chose WordPress is simply because of the fabled 5 minute install process – I...
19 Jun 2008

Redesigning the WordPress admin Redesign

Ever since the first betas of WordPress 2.5 I have been making my own version of the admin panel. I like a lot of what they have done but there were some very basic things missing in the design, and...