How-to Increase the Size of your WordPress Thumbnails

You may have noticed that recently the size of my blog’s thumbnail images are now larger than they were in the past. Previously, they were at 128 pixels wide, or about the size of a stamp.

Recently, Snoskred had a post about how to upload an image to your WordPress blog, and in it I made a comment about that the small size of the thumbnails was a drawback to WordPress.

However, as I was making that comment, I did a search about if it’s possible, and, like almost everything else in WordPress, you can change the thumbnail to whatever size you would like. I found the original instructions here. In fact, the change is so simple, you don’t really need to deal with reuploading files to FTP. However, you might need to change some file permissions, which isn’t as painful as it sounds.

Going to the WordPress file editor

To edit the file, you don’t actually need any special software – all you need is your WordPress Admin panel. One of the hidden secrets of WordPress is the built-in file editor which allows you to edit any file that is in your WordPress installation.

To access the editor, go into your Admin Dashboard and click on Manage. Then click on Files. When you load the page, generally, the last file that was opened will load, which will generally be your theme’s style sheet.

At the bottom of the page, there is a section called “Other Files” which allows you to type in the name of a file and then edit that file. In the line that is there type this – wp-admin/includes/image.php and click Edit file »

The file will load into the editor, and if the file permissions are not set properly, this message will appear – If this file were writable you could edit it. In that case, you will need to go into your FTP program and change that file’s attributes to 666 – as is recommended by WordPress.

If your file permissions are correct from the outset, or after changing your file’s permissions and reloading the editor page, the message about the file being writable will be replaced with an Update File » button in the lower right of the screen.

Editing the file

With that, you’re now ready to make the necessary changes to your image.php file.

This will go a lot easier if you’re using Firefox 2.0 – which allows you to search inside of text boxes; older versions of Firefox and other browsers do not allow you to do the same thing.

What you will need to do is search for the following text –

if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) { $max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file ); $thumb = wp_create_thumbnail( $file, $max_side );

In this section of text, simply change the 128 that is currently there to the size of thumbnail that you want to use - I've gone with 256 (which is twice the size of the default, and a much better size to allow you to see details).

Once you have changed the number, simply click on Update File », and then you are done! Enjoy your new thumbnails! 🙂

2 thoughts on “How-to Increase the Size of your WordPress Thumbnails

  1. Thanks Sephy. I finally got around to doing this for my blog. It is amazing me how simple a lot of these processes are if you can just find someone who’ll explain them nice and simply and clearly. 🙂 Thanks for taking the time to post about this stuff – it’s really helping me (even if it takes me a while to get there!!!)

Comments are closed.