Sometimes you’d like to change the default thumbnail (or Medium/Large) image dimensions when the user is switching to your WordPress site. The default setting for a thumbnail is 150×150 pixels. See this article for a tutorial guide on how to edit and change the default dimensions of the thumbnail size image when the user is switching to your WordPress site.
Thumbnail Size in WordPress
This thumbnail uses “hard cropping” because we enabled the “Crop thumbnails to exact dimensions” setting. This means that WordPress will take the thumbnail size you set, “fill” that area with the image you use and ignore the rest of the image. “Soft cropping,” on the other hand, is a resizing that shrinks an image while maintaining its proportions.
First, choose a new default thumbnail size. Then remember to save the changes to the settings. After you set a new default thumbnail size, WordPress will use it for all future uploaded images.
The best tool for that job is the Thumbnail Regenerate WordPress plugin. This plugin takes all your existing thumbnails and resizes them one by one. It also works with WordPress’s other image sizes (medium, large, etc.). This means that you can use them even if you change the default sizes of these (more on that later).
Getting started:
- Install and activate the plugin.
- Then go to Settings > Rebuild Thumbnails tab, select the images you want to resize, and click the Rebuild All Thumbnails button.
- The process may take some time.
- So wait patiently until you see the “Done” message before closing the tab.
Reasons to Change Your WordPress Thumbnail?
We explained how to edit the thumbnail in WordPress but haven’t yet explained why. WordPress’s default thumbnail size of 150×150 pixels may work well for some users, but no single image resolution suits all designs.
For example, consider large thumbnails that highlight more detail. This is especially true if you run an e-commerce store. Alternatively, you can use a more rectangular shape, especially for featured images on blogs and news sites.
If you’re redesigning your site or trying out a new theme, it’s also a good idea to experiment with image sizes to see what works best with your new style. Moreover, the process is so easy that it takes less than a few minutes and doesn’t affect your existing media library unless you install the additional plugins mentioned above.
Custom Image Sizes in WordPress
When you upload an image to WordPress, the platform works its magic in the background, resizing the image in multiple dimensions for you to use. As mentioned earlier, this includes thumbnail, medium, and large-sized images. Different sizes of the same image make your life easier as you can choose the option that best suits your needs.
You can change these default image sizes using the steps above. However, you can also add new standard sizes to your site. This can be a favorable option. You can set specific sizes for all the different image types on your site, eliminating the need to resize each new image manually.
To add a new default image size to WordPress, edit your theme’s function.php file. This means connecting to your site using a File Transfer Protocol (FTP) client such as FileZilla and navigating to the root folder of your site. Once there, open the wp-content/messages directory and look for a folder named after your theme.
Inside this folder, there should be a “functions.php” file. After that, right-click on it and click View/Edit option. This will open the file in your local text editor so you can change it.
Be careful when modifying your theme’s “functions.php” file; do not modify the existing content. Instead, add the new code snippet below:
Code Example to WordPress Thumbs
// This enables the function that lets you set new image sizes
add_theme_support( ‘post-thumbnails’ );
// These are the new image sizes we cooked up
add_image_size( ‘post-image’, 660 );
// Now we register the size so it appears as an option within the editor
add_filter( ‘image_size_names_choose’, ‘my-custom-image-sizes’ );
function my-custom-image-sizes( $sizes ) {
return array_merge( $sizes, array(
‘post-image’ => __( ‘Post Images’ ),
) );
}
The comments in this code explain how it works. First, tell WordPress you want to add a new image size to your theme. A new default option is then created. Registers it so it shows up within the editor the next time you open it.
add_image_size ( ‘post-image’, 660 ) ;
When adding a new custom image size, you can set the width and height. This example sets the width. This will always be the first value. WordPress will resize the image to a height proportional to the desired width. If you also wanted to add a specific height, the line would instead look like this:
add_image_size ( ‘post-image’, 660, 480 ) ;
Also, use a new row for each custom size you want. Then save the changes to your functions.php file, and you’ll see your new options in the WordPress editor.
Final Thoughts on Thumbnail WordPress Usage
We hope this tutorial guide on how to edit and change default thumbnail size image dimensions when users switch to your WordPress site has helped you learn how to add custom image sizes in WordPress. You can also check out our guide on customizing your WordPress permalinks.