• Resolved abgross1

    (@abgross1)


    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)
  • Hi @abgross1,

    I apologize for the wait on this reply! If you are still having issues, I know that Divi overrides a lot of thumbnail and image controls, so it is best to reach out to your theme provider and make sure the code is recognized by the theme. If you are still having issues please let us know though!

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @abgross1 We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

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.