It’s nice to be able to change the default thumbnail size for image uploads in Wordpress. I upload tons of big pictures and it’s nice if the thumbnail just fits within the content width. So here is an easy way to make this change in Wordpress. They have introduced the wp_thumbnail_max_side_length filter that can be used to change the default size in plugings and so forth, but this is far easier.
Navigate to your wp-admin folder in your Wordpress installation. Edit admin-functions.php and head to line 2228. You should find this line:
$max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );
The default max size is 128px. You can choose what you want for this now. This size determines the maximum size of any side of the image. For my template though, I only care about width. I always want the thumbnail to be as wide as the template. To make that change, go to line 2276 of the admin-functions.php file. Change the following line:
if ( $image_attr[0] > $image_attr[1] ) {
To:
//if ( $image_attr[0] > $image_attr[1] ) {
if (1) {
That’s it! Now Wordpress will always scale the thumbnail according to the width. Save your changes and try em out.







No user commented in " How To Change Default Wordpress Thumbnail Size "
Follow-up comment rss or Leave a TrackbackLeave A Reply