-
AuthorPosts
-
June 3, 2024 at 1:18 pm #1447547
Hi is there a bit of css that I can use to get all the shop images to shrink to fit the square boxes? Currently they are cropping out parts of the image that don’t fit in the box.
Many thanksJune 4, 2024 at 4:49 am #1447611Hey fanlokbun,
Thank you for the inquiry.
You may need to adjust the size of the thumbnail in the Appearance > Customize > WooCommerce > Product Images panel. Adjust the value of the Thumbnail width based on the usual size in which you upload the image, and set Thumbnail cropping to Uncropped.
Best regards,
IsmaelJune 4, 2024 at 9:53 am #1447729Many thanks Ismael I’ll give that a go.
June 12, 2024 at 1:00 pm #1449038Hi I can’t get it to work. See the image below for how I have it set.
Many thanks
RobJune 12, 2024 at 11:04 pm #1449150Hi,
Please link to the page with the screenshot so we can see if the image is truly cropped or if the image can be corrected with css ” background-size: contain”Best regards,
MikeJune 12, 2024 at 11:13 pm #1449153See below:
June 13, 2024 at 5:01 pm #1449532Hi,
Thanks, I see that the image is truly cropped because the your thumbnail size is cropped. Your image is not a square image so the 450×450 thumbnail will crop it.
So if you want your product catalog to have a uniform look you can create a new image that is square instead of portrait and upload your new image, then the book will be centered in your 450×450 thumbnail.
or if your shop is going to be a book store and all of your thumbnails will be a portrait shape image, you can try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function override_post_thumbnail_size($size, $post_id) { if (is_archive()) { return 'full'; } return $size; } add_filter('post_thumbnail_size', 'override_post_thumbnail_size', 10, 2);
this will show the full size image instead of the thumbnail.
Best regards,
MikeJune 14, 2024 at 10:08 am #1450298Hi Mike yes I know uploading square pictures would resolve the issue. The shop is going to be run by old aged pensioners with very little technical expertise. I want to make it as easy as possible for them so I was hoping there would be a “fit to longest side” CSS command for the thumbnails. I thought it was something we had achieved in the past but may be mistaken.
Thanks
RobJune 14, 2024 at 11:55 am #1450365 -
AuthorPosts
- You must be logged in to reply to this topic.