How To Resize Thumbneil Image In WordPress

Posted by

Hi,

First thumbnail generated by the WordPress system defaults, therefore its size should be 128 pixel and automatically alters the height aspect ratio to match. But Many times we need to resize the thumbnail image on our blog. Instead of doing for each thumbnail image you can do it by editing simple wordpress core file. I have described it here:

1) Open wp-admin/inline-uploading.php in editor.
2) Find this code. It should be on Line 88:

if ( $imagedata[‘width’] > 128 &&
$imagedata[‘width’] >= $imagedata[‘height’] * 4 / 3 )
$thumb = wp_create_thumbnail($file, 128);
elseif ( $imagedata[‘height’] > 96 )
$thumb = wp_create_thumbnail($file, 96);

Replace with:

if ( $imagedata[‘width’] > 256 &&
$imagedata[‘width’] >= $imagedata[‘height’] * 4 / 3 )
$thumb = wp_create_thumbnail($file, 256);
elseif ( $imagedata[‘height’] > 192 )
$thumb = wp_create_thumbnail($file, 192);

This will double the thumbnail size. You can set it as per your requirement.

That’s it!

Thanks,

Shane G.

Leave a Reply

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