Home › Forums › WoodMart support forum › Make product images square on mobile
Make product images square on mobile
- This topic has 9 replies, 2 voices, and was last updated 5 years ago by Artem Temos.
-
AuthorPosts
-
November 26, 2019 at 2:54 pm #159144
horny_fungusParticipantHi, my product images are originnaly 2000 x 1500 px files. This 4×3 format is great for single product page product images on desktop because square image doesn’t fit the browser window on smaller laptop screens but it’s too small for mobile. Therefore I want to have 4:3 product images for desktop and 1:1 product images for mobile. I tried to achieve this with following code:
if( wp_is_mobile() ) { add_filter( 'woocommerce_gallery_image_size', function( $size ) { return 'Thumbnail'; } ); }
but it didn’t work although thumbnail size is set and there are images of that size.
Can you please provide any suggestion on the above code or another solution?November 26, 2019 at 3:07 pm #159146
horny_fungusParticipantActually ‘woocommerce_gallery_image_size’ filter does not work even alone without wp_is_mobile() function.
November 27, 2019 at 3:05 am #159145
Artem TemosKeymasterHi,
Sorry, but there is no such option in our theme and WooCommerce by default. It may require additional code customization or extra plugin but we don’t have an instruction for this. It is out of our theme support scope.
Regards
November 27, 2019 at 9:02 am #159305
horny_fungusParticipantOK, another way to solve the issue would be to use 1:1 images everywhere but adjust single product page columns – make right column with product details little bit wider and left column with image little bit narrower.
November 30, 2019 at 8:26 am #160094
horny_fungusParticipantHi, just a kindly reminder about my problem.
November 30, 2019 at 9:55 am #160107
Artem TemosKeymasterHello,
You can change the width of the block with image in Theme Settings -> Product page -> Images -> Product image width.
Kind Regards
November 30, 2019 at 10:14 am #160114
horny_fungusParticipantThank you. I forgot about this settings. unfortunately medium image size seems to small for my needs. Something inbetween medium and big would be ideal for my site, how I can achieve this?
November 30, 2019 at 5:46 pm #160199
Artem TemosKeymasterSorry, but there is no such kind of layout for the single product page. You can select between available in Theme Settings only.
December 1, 2019 at 12:10 pm #160333
horny_fungusParticipantOK, can you please at least give me some direction to where it can be customised?
December 1, 2019 at 10:30 pm #160374
Artem TemosKeymasterYou can try to do this with CSS code and adjust the width of the images and summary blocks.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register