How to Create Different Size Thumbnails in WordPress – 2026

Last updated on August 11th, 2024 at 10:31 am

Creating different size thumbnails in WordPress can greatly enhance the visual appeal and user experience of your website. By generating custom thumbnails for various sections of your site, you ensure that images look perfect, no matter where they appear. In this guide, we’ll walk you through the process of creating and managing different size thumbnails in WordPress without using any plugins.

Why Create Different Size Thumbnails?

Having different size thumbnails allows you to:

  • Optimize Image Display: Ensure images look great on all devices and sections of your site.
  • Improve Page Load Times: Use appropriately sized images to reduce load times.
  • Enhance User Experience: Provide a visually cohesive experience across your site.

Step 1: Register New Thumbnail Sizes

To start, you need to register new thumbnail sizes in your theme’s functions.php file. If you don’t have a child theme, you can use our free child theme generator.

  1. Open your child theme’s functions.php file.
  2. Add the following code to register new image sizes:
/*
 * Snippet: How to Create Different Size Thumbnails in WordPress – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1361
* Tested with WooCommerce 10.7.0
* "Register new thumbnail sizes"
*/ function wcsuccess_custom_thumbnail_sizes() { // Add new image sizes add_image_size('custom-size-small', 100, 100, true); add_image_size('custom-size-medium', 300, 300, true); add_image_size('custom-size-large', 600, 600, true); // Add to media library selection add_filter('image_size_names_choose', 'wcsuccess_custom_sizes'); } add_action('after_setup_theme', 'wcsuccess_custom_thumbnail_sizes'); function wcsuccess_custom_sizes($sizes) { return array_merge($sizes, array( 'custom-size-small' => __('Custom Size Small'), 'custom-size-medium' => __('Custom Size Medium'), 'custom-size-large' => __('Custom Size Large'), )); }

Step 2: Regenerate Thumbnails

After registering new image sizes, you need to regenerate thumbnails for existing images to make use of the new sizes. You can do so by either adding some code to regenerate thumbnails without a plugin or use the plugin below:

  1. Install and activate the Regenerate Thumbnails plugin.
  2. Go to Tools > Regenerate Thumbnails.
  3. Click the Regenerate Thumbnails button to regenerate all images.
See also  How to Set Up a Loyalty Program in WooCommerce Without Using a Plugin - 2026

Step 3: Use Custom Thumbnails in Your Theme

Now that your thumbnails are generated, you can use them in your theme templates.

  1. Open the template file where you want to display the custom thumbnails.
  2. Replace the existing the_post_thumbnail() function with your custom size:
/*
 * Snippet: How to Create Different Size Thumbnails in WordPress – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1361
* Tested with WooCommerce 10.7.0
* "Use custom thumbnail sizes in theme templates"
*/ if (has_post_thumbnail()) { the_post_thumbnail('custom-size-medium'); // Replace 'custom-size-medium' with your desired size }

Step 4: Display Custom Thumbnails in Widgets

To display custom thumbnails in widgets, such as recent posts or related posts widgets, you need to modify the widget’s code.

  1. Open the widget’s template file.
  2. Replace the thumbnail size parameter with your custom size:
See also  How to Open WooCommerce Products in a New Tab - 2026

Conclusion

By following these steps, you can easily create and manage different size thumbnails in WordPress. This approach allows you to optimize your site’s visual presentation, improve page load times, and enhance the overall user experience without relying on additional plugins.

For more customisation tips and tools, don’t forget to check out our free WordPress child theme generator.

0 0 votes
Article Rating

Stay In Touch

Was this post helpful? Why not show your support and buy me a coffee?

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top
0
Would love your thoughts, please comment.x
()
x
×