Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #551315

    Hello,

    I noticed that when I use lightbox the theme loads the full size version of the image. We upload high-res images as source images so it is loading 3500+ px images. Is it possible to change it to extra-large or large?

    It looks like all other sizes are loaded with the correct version instead.

    Best

    Sigifin

    P.S.: I already tried this without effects:

    function change_lightbox_size() {
    	return "large"; // default is 'large'
    }
    add_filter('avf_avia_builder_helper_lightbox_size', 'change_lightbox_size', 10);
    • This topic was modified 8 years, 11 months ago by sigifinsrl.
    #551964

    Hi sigifinsrl,

    Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.

    Thanks,
    Rikard

    #552061

    Hi Rikard,

    thank you for the support, here you have the credentials.

    It is a clean import of your shop template!

    Best

    Sigifin

    #553529

    Hello
    I’m very interrested to know how to use this hook too.
    I tried many things, change the excecution priority from the lowest to the highest and has no effects…

    #556102

    Hey!

    I think this is more about a general WordPress issue, than a theme related one. So feel free to ask in general WordPress forum about it. Maybe this plugins could help you guys:
    https://wordpress.org/plugins/max-image-size-control/
    https://de.wordpress.org/plugins/simple-image-sizes/

    Cheers!
    Andy

    #556137

    Hi Andy,

    if this is the situation I suggest to use imsanity (https://wordpress.org/plugins/imsanity/), but this is not what I was looking for.

    It looks very strange to me that you can’t set the lightbox to load a thumbnail instead of the original image, are you really sure about it?

    Best

    Sigifin

    #556401

    Hello
    No answer about how to use Enfold ‘avf_avia_builder_helper_lightbox_size’ hook?
    Thanks

    #557609

    Hey!

    Sorry for the delay. Please replace the code in the functions.php file with this:

    add_filter('single_product_large_thumbnail_size', funtion() {
    	return 'large'; //default "shop_single"
    });
    

    EDIT: Please ignore the code above. Use this instead:

    add_filter('woocommerce_single_product_image_html','avia_woocommerce_post_thumbnail_description', 10, 2);
    function avia_woocommerce_post_thumbnail_description($img, $post_id)
    {
        global $post, $woocommerce, $product;
    
        if(has_post_thumbnail())
        {
            $image_title = esc_attr(get_post_field('post_content', get_post_thumbnail_id()));
            $image_link  = ;wp_get_attachment_image_src(get_post_thumbnail_id(), apply_filters('avf_avia_builder_helper__shop_lightbox_size','large'));
            $image  = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array(
                'title' => $image_title
                ) );
            $attachment_count = count( $product->get_gallery_attachment_ids() );
    
            if ( $attachment_count > 0 ) {
                $gallery = '[product-gallery]';
            } else {
                $gallery = '';
            }
    
            return sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s"  rel="prettyPhoto' . $gallery . '">%s</a>', $image_link[0], $image_title, $image);
        }
    
        return $img;
    }

    Regards,
    Ismael

    #558041

    Hi @ismael
    I’m afraid I do not understand your answer… Why do you give me php code about changing Woocommerce stuff?
    My question was about how to use you ‘avf_avia_builder_helper_lightbox_size’ hook?
    Thanks

    #558050

    Hi Ismael,

    when I use your code in a clean import of Enfold Shop Theme I get an error 500.

    Best

    Sigifin

    #558638

    Hey!


    @pako69
    : The OP wanted to change the size of the PRODUCT images in the lightbox. The filter posted by the OP won’t affect the products. If possible, please create your own thread. Thank you.


    @sigifinsrl
    : Please copy the code directly from this forum, not from your email. Let us know if it is working.

    Regards,
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.