How to Get WooCommerce Thumbnail Size

If you’re using the WooCommerce plugin for WordPress, you may want to change the thumbnail size. The default size is 150 pixels square, but WooCommerce generates its own thumbnail image sizes.

The size name of WooCommerce image size is “woocommerce_thumbnail” and “shop_catalog”. After knowing the names, we can retrieve them from a list of image size names with a global variable called $_wp_additional_image_sizes.

//get all size names with their dimensions
global $_wp_additional_image_sizes; 

//get width and height of woocommerce_thumbnail
$woo_image_size = $_wp_additional_image_sizes['woocommerce_thumbnail']['width'].'x'.$_wp_additional_image_sizes['woocommerce_thumbnail']['height'];

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close