Crop Product Page main photos with x, y coordinates (from bottom not center)
-
I’m wanting to crop my featured image product page photos and need the top of the photo cropped off instead of it being cropped automatically to the center of the photo. I’m using a Divi child theme and WC Product Builder plugin for WooCommerce. I found the below code that worked to crop the image to 497×518 on the product page, but I’ve tried several different things found online to adjust where the cropping starts with no luck. Thanks in advance for anyone’s help!
(Added to my child theme’s functions.php folder):
add_filter( 'woocommerce_get_image_size_single', 'hc_set_product_img_size' ); add_filter( 'woocommerce_get_image_size_shop_single', 'hc_set_product_img_size' ); add_filter( 'woocommerce_get_image_size_woocommerce_single', 'hc_set_product_img_size' ); function hc_set_product_img_size() { $size = array( 'width' => 497, 'height' => 518, 'crop' => 1, ); return $size; }
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Crop Product Page main photos with x, y coordinates (from bottom not center)’ is closed to new replies.