1

I get the image through wordpress built in post_thumbnail, but i see a lot of developers use timthumb for that and i don't know why! is it more flexible or something?

2 Answers 2

1

There are two reasons:

  1. post_thumbnail was introduced with WordPress 2.9, and many themes which used TimThumb because post_thumbnail wasn't yet available to them.
  2. TimThumb is more flexible than post_thumbnail — it gives you more options for how images are cropped, and allows for simple filters to be applied to the images.

However, TimThumb has also caused security issues, especially with sites which didn't keep their themes (and because of this their timthumb versions) up to date. Because of this, it often makes more sense to use post-thumbnail, especially if you don't need much beyond WordPress' built-in cropping for thumbnails.

2
  • I have a question: post_thumbnail doesn't work with already existed images, so i have to tell the user to setup the regenerate thumbnail plugin to regenerate the thumbnails, do i have to do that with timthumb too? does it work with already existed images? Feb 2, 2013 at 15:20
  • 1
    @Elshereef & Gavin, see kaiser and Otto solutions to deal with Dynamic Images.
    – brasofilo
    Feb 2, 2013 at 17:37
0

Yes, it is more flexible. It allows you to resize or crop image in way you want ( check it's parameter listing: http://www.binarymoon.co.uk/2012/02/complete-timthumb-parameters-guide/ ). And have a look at project's homepage also: http://www.binarymoon.co.uk/projects/timthumb/

On the other side, if you do not need to use advanced image manipulation's, WordPress feature image (post_thumbnail) is OK. I, personally, have never uset timthumb in my themes and they all are working good. Especially when you can add_image_size

1
  • Thanks a lot it seems that post_thumbnail is enough for me, Thanks again for your help. Feb 2, 2013 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.