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
}