Thread Starter
phj123
(@phj123)
The question is quite easy:
224X224 crop
504
1134
Those sizes I used before and I need to still use them after the update.
How can I get the image settings back the way they were and tell woocommerce to use the:
shop_thumbnail
shop_catalog
shop_single
Instead of:
woocommerce_thumbnail
woocommerce_thumbnail 2x
woocommerce_single
Thread Starter
phj123
(@phj123)
Why this isn’t working???
/**
* Add Image sizes.
*/
function customize_image_sizes($sizes) {
unset( $sizes[‘thumbnail’]);
unset( $sizes[‘medium’]);
unset( $sizes[‘medium_large’]);
unset( $sizes[‘large’]);
unset( $sizes[‘woocommerce_thumbnail’]);
unset( $sizes[‘woocommerce_thumbnail_2x’]);
unset( $sizes[‘woocommerce_single’]);
unset( $sizes[‘wysija-newsletters-max’]);
return $sizes;
}
add_filter(‘intermediate_image_sizes_advanced’, ‘customize_image_sizes’);
add_image_size(‘responsive_small_medium’, 336, 336, false );
add_image_size(‘responsive_medium_large’, 756, 756, false );
add_filter( ‘woocommerce_resize_images’,’__return_false’ );
add_filter( ‘woocommerce_background_image_regeneration’,’__return_false’ );
/**
* Define image sizes
*/
function yourtheme_woocommerce_image_dimensions() {
$catalog = array(
‘width’ => ’1134’, // px
‘height’ => ’1134’, // px
‘crop’ => 0 // false
);
$single = array(
‘width’ => ’504’, // px
‘height’ => ‘504’, // px
‘crop’ => 0 // false
);
$thumbnail = array(
‘width’ => ’224’, // px
‘height’ => ’224’, // px
‘crop’ => 1 // true
);
// Image sizes
update_option( ‘shop_catalog_image_size’, $catalog ); // Product category thumbs
update_option( ‘shop_single_image_size’, $single ); // Single product image
update_option( ‘shop_thumbnail_image_size’, $thumbnail ); // Image gallery thumbs
}
Hello, I am also having an issue with product image thumbnails, as explained here:
https://wordpress.org/support/topic/product-thumbnail-images-issue-on-3-3/
I’ve found out that the problem is that I am loading my images from Amazon Cloudfront and WC 3.3 instead of rendering “thumbnail_image_width” in my product image thumbnails, it calls to the natural uploaded image, which s a very bad thing in terms of web performance.
-
This reply was modified 8 years, 2 months ago by
retroriff. Reason: I've found the origin of my issue
Sorry about the delay here. You can use a plugin like Simple Image Sizes to specify the sizes of the images and if they should be cropped : https://wordpress.org/plugins/simple-image-sizes/
http://cld.wthms.co/U3Lxq1
I am going to set this thread as resolved, if need be, we can remove the resolved status.