Custom Thumbnail Sizes Using The Attached Image & Timthumb

/ Wordpress / by Paul Robinson / 0 comments
This post was published back on December 14, 2009 and may be outdated. Please use caution when following older tutorials or using older code. After reading be sure to check for newer procedures or updates to code.

I promised a while ago I would do this tutorial and I’m ashamed to say I never got round to it. I wouldn’t care it isn’t that complicated so it would have only taken me about 20-30 minutes to write. Oh well, better late than never.

To use The Attached Image along with Timthumbs is easy. I am assuming you have placed the Timthumb script in a folder called timthumb in your current active theme folder. You can download timthumb from it’s Google Code site.

Here we go. Here is an example of creating a 100×100 square thumbnail.

That will create a 100×100 image using timthumb. As long as your WP small thumbnail size is greater than 100×100 that will work fine. If not supply the img_size parameter with medium, large, or full to use a larger image. It’s important you do that as it will save you server resources to use timthumb on an image only moderately larger than the size you want. For example, don’t ask for the full image if you only want to make a 50×50 thumbnail, use the thumb size instead.

Why use timthumb? Well you can only have 1 thumbnail generated within WP that is cropped square, so if you need multiple sizes of cropped thumbnails then it’s great. Generally though it’s used for featured posts sections in theme layouts.

Anyway I hope that helps anyone wanting to generate thumbnails using TAI & Timthumb. If you’ve any questions leave them in the comments or send them to me via the contact page.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

I'll keep your WordPress site up-to-date and working to its best.

Find out more