Home/ Journal Bens Projects Binary Moon Archives About Ben Gillbanks Subscribe to Binary Moon Updates

Subscribe to Binary Moon Website Updates, it's Free and Easy to Stay in Touch

Search Binary Moon

Search Binary Moon

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.

16 Responses to “WordPress 2.9 – the_post_image” Leave a reply ›

  • Agreed. Though it's a nice feature, the dynamic PHP resized scripts work real nice for custom development themes, and designs.

    • Profile

      Yeah - I'm sure there are people who will use the new script, but for me it's not practical. Perhaps for my own designs, but for ones I give away/ sell I think I need more control to make sure they work as intended.

  • Strange that they didn't design something to be expandable eh?

    It's a mega bummer that WP is getting so bloated with weird things lately. I wish they would start it all over again, vanilla fresh & clean things up.

    • Profile

      I think they are too far along to be able to start things again, but it would be nice if they spent a couple of versions simply tidying up and optimizing all of the code (front and back end). The software itself does everything I need, so speeding it up and polishing the way it works are the top of my personal feature lists.

    • Profile

      Hey John - I hadn't seen that, thanks for pointing it out. The code looks interesting but doesn't really fix the issue I have. I want to be able to set the dimensions when I call the the_post_image so that the image is resized and cropped to fit my requirements. Unless I misunderstood it - that patch seems to be simply rebuilding the previously generated thumbnail images.

  • Just means we are stuck using image handling plugins still. Sigh.

  • I really don't see the point of using Automatic resizes. Its a quick and dirty way to post however, how does the script know what to crop out :( ?

    Cropping is always something that the post author should take care of. Then perhaps, include it in the post and then display with the_post_image.

    I think its decent and a great new addition !

    • Profile

      I can totally understand your point of view, and for some that's the way to go, but personally I like the ease of use of the automated thumbnails. I like not having to worry about creating multiple images for multiple scenarios. I like being able to change my design and not having to go through and recreate all the thumbnails. In face I recently redesigned my blog, adding automated thumbnails and the icons "just appeared", even though I had never set any before. I think that's pretty awesome :)

      • If you're going to need a custom size (say 'ben-custom-post-image-size') then just hook into the appropriate WordPress filters. You're not forced to use the default of small, medium, large, and full. You can use other sizes if you want to.

        Just throw the hooks into your theme's functions.php file and you'll have no problem :)

      • Profile

        Hey Nick - that sounds quite interesting, I am going to have to look into that. Does that mean the code will resize the images in real time if they don't exist?

      • Or, you can just use my plugin which allows you to create additional image sizes and recreate the thumbnails: http://wordpress.org/.../plugins/additional-image-sizes/

        Hope this helps.

  • Hey,
    just wanted to point out a few things.. with the 2.9 post thumbs feature you can create as many different sizes as you need and call them wherever you want.. You can also set if it simply resizes the image or hard crops it..

    I'm digging this new feature a lot and use it all over my site. I also have a post outlining how to set up a theme to support it.. if you want to check it out you can by reading my post Upgrade Your Theme To Support WordPress 2.9 Post Thumbnails

    have a great weekend :-)

    Jesse

Leave a Reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

About me

About BenMy name is Ben Gillbanks. I'm a lover of Video Games, WordPress, Web Development and everything in between.

I have been working on the internet since 1998, and working with computers even longer. I am a hardcore Nintendo fanboy and have owned most of their consoles at one stage or another.

Read more about me on my about page.


Follow Me


Random Link-outs

The Binary Network links to all my websites
bengillbanks.co.uk - Ben Gillbanks

Ben Gillbanks

All my websites under 1 roof, the easiest way to find out what I do

Pro Theme Design - premium WordPress themes

Pro Theme Design

Premium WordPress themes by web design pros (erm... that includes me)

Binary Joy - gaming news and reviews

Binary Joy

Gaming news and reviews

Binary Sun - play free online games

Binary Sun

Play and download free and paid games (many made by me)

Gaming Angel - download and play games online

Gaming Angel

Stacks of shareware games, free to try and cheap to buy