Created
March 20, 2020 16:12
-
-
Save diggeddy/199d6da31b04b9fc2d73b2d8d6b8d54b to your computer and use it in GitHub Desktop.
Increase Gallery thumb size and reduce columns from 4 x 100px to 3 x 250px
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 | |
// Set gallery thumbnail size | |
// Run Regenerate Thumbnails if size is not defined in media | |
function woo_gallery_thumb_size( $size ) { | |
return array( | |
'width' => 250, | |
'height' => 250, | |
'crop' => 1, | |
); | |
} | |
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'woo_gallery_thumb_size' ); | |
?> | |
/* Custom CSS */ | |
/* convert 4 image galler to 3 */ | |
.woocommerce div.product div.images .flex-control-thumbs li { | |
max-width: 100% !important; | |
width: 33%; | |
} | |
.woocommerce div.product .woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n+1) { | |
clear: none; | |
} | |
.woocommerce div.product .woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(3n+1) { | |
clear: left; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment