I’m trying to use WordPress’ built-in thumbnailing and image re-sizing in my WordPress 2.9.2 installation. I’m trying to get various sizes (post listing/results 160×160 & “single.php” 618×150) and for some reason the single.php one works, but only half way. Not sure if I’m doing something wrong here.
I have it workingâ¦sorta. Iâm totally stuck and there seems to be a lack of documentation on the Codex for this feature so here goes.
The small 160Ã160 thumbnail for article listings/search views works fine. It crops it, allâs groovy. The issue comes when I go to format the image for the single.php article details view. It crops, but then scales down even further for some reason.
Screenshot:
http://c1319072.cdn.cloudfiles.rackspacecloud.com/4-15-2010%204-56-46%20PM.png
NOTE: every time I re-test this Iâm completely deleting the image from the media section and re-uploading the image entirely. I also have the re-create thumbnails plugin so I know itâs not caching.
Here is my code included in “functions.php”. This will help in debugging.
add_theme_support( âpost-thumbnailsâ );
set_post_thumbnail_size( 160, 160, true ); // Normal post thumbnails
add_image_size( âsingle-post-thumbnailâ, 618, 150, true ); // Permalink thumbnail size
I just wrote a detailed post regarding the wordpress post thumbnails a few days ago, you might find it very useful as it is very detailed.
How to use Post Thumbnails Feature in WordPress!
I had similar problems trying to get it to work and finally went with TimThumb.
I simply love it’s simplicity and effectiveness. It works great, has cache capabilities and it’s fast and easy.
Official site (includes tutorial): http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/
And here’s an example on how I call it in my WordPress:
(loads the image URL from a custom field of the post and resizes it to 75×75 and 90% quality)