3

Wordpress let you choose between thumb medium large and full size when uploading and inserting an image into a post or a page.

The meaning of full is obvious. But how WordPress set size for thumb (I seem to remember 150x150 and in some cases 200x200), medium and large?

Are there fixed sizes or can they vary according to the original image sizes?

  • 1
    In the admin dashboard, look under Settings > Media. Defaults are 150x150, 300x300 and 1024x1024, but you can change them. – Gabriel Jan 1 '15 at 18:42
  • 1
    You can also add additional custom image sizes using the add_image_size function. – Gabriel Jan 1 '15 at 18:49
  • Post as an answer? – jdm2112 Jan 1 '15 at 19:13
5

The defaults are Thumbnail 150x150, Medium 300x300, and Large 1024x1024. The fixed values can be changed in the admin dashboard under Settings > Media. You can also change them in your theme's functions.php:

update_option( 'thumbnail_size_w', 160 ); // Set Thumbnail width - default 150
update_option( 'thumbnail_size_h', 160 ); // Set Thumbnail height - default 150
update_option( 'thumbnail_crop', 1 );     // Set Crop mode - 0 Soft, 1 Hard

The above sets Thumbnail to 160x160 and Hard crop mode (vs Soft proportional crop mode with a value of 0). Hard crop will actually crop the image to fit the width and height, where as Soft crop will resize the image to fit within the dimensions. I.e. a 800x600 with soft crop would end up being 160x120 instead of 160x160 with Hard crop, but the full down-sized image would still be visible.

You can also create additional custom image sizes using the add_image_size() function, i.e.

add_image_size( 'home-mini', 50, 50, TRUE ); // Custom Name, Width, Height, Crop mode

For more information, see the Codex.

4

The default post thumbnail/image sizes are set as follows

  • thumb 150x150
  • medium 300x300
  • large 1024x1024

These defaults are set in wp-admin/includes/schema.php, currently in version 4.1 line 445 - 456

'thumbnail_size_w' => 150,
'thumbnail_size_h' => 150,
'thumbnail_crop' => 1,
'medium_size_w' => 300,
'medium_size_h' => 300,
.....
'large_size_w' => 1024,
'large_size_h' => 1024,

These defaults are set when Wordpress is first installed (fresh install). This defaults can be set to custom sizes under Settings->Media

Are there fixed sizes or can they vary according to the original image sizes?

These sizes are fixed and don't vary from one image to another. However, if the image being uploaded is smaller than a thumbnail size, then the thumbnail is set to that size, images are not upscaled

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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