Created
March 4, 2018 04:09
-
-
Save doubleedesign/21bdfcb89622b99ac318494053cf9eff to your computer and use it in GitHub Desktop.
Customise width and height of WooCommerce images since the way it handles images changed in 3.3. More detail on these filters at https://github.com/woocommerce/woocommerce/wiki/Customizing-image-sizes-in-3.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Customise the product image and gallery thumbnail to ensure they match | |
function doublee_custom_woo_images() { | |
return array( | |
'width' => 600, | |
'height' => 476, | |
'crop' => 1, | |
); | |
} | |
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'doublee_custom_woo_images' ); | |
add_filter( 'woocommerce_get_image_size_thumbnail', 'doublee_custom_woo_images' ); | |
add_filter( 'woocommerce_get_image_size_single', 'doublee_custom_woo_images' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment