Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1494435

    Hi

    We are updating a site for our client and he wants enlarged images to display at full size (1500px) wide in lightbox when a smaller image element is clicked upon.

    We were advised to add the following into the functions.php file. However, I think this only works in an image gallery?

    function avia_change_gallery_thumbnail_link($link, $attachment, $atts, $meta){
    $link = wp_get_attachment_image_src($attachment->ID, “full”);
    return $link;
    }
    add_filter(‘avf_avia_builder_gallery_image_link’, ‘avia_change_gallery_thumbnail_link’, 10, 4);

    Is there a way of forcing enlarged images to display full size when clicking smaller or thumbnail elements?

    Thanks in advance

    Steve

    #1494478

    Hey steve159159,

    Thank you for the inquiry.

    You can use this filter in the functions.php file to adjust the default size of the lightbox image.

    function avf_alb_lightbox_image_size_mod($size) {
      return "full";
    }
    add_filter('avf_alb_lightbox_image_size', 'avf_alb_lightbox_image_size_mod', 10, 1);

    This defaults to large and we set it to full (the original size of the image). You can also remove this filter and adjust the size of the Large thumbnail in Settings > Media panel. You’ll need to regenerate the thumbnails afterward.

    https://wordpress.org/plugins/regenerate-thumbnails/

    Best regards,
    Ismael

    #1494490

    Hi Ismael

    Many thanks for your response. Unfortunately this doesn’t seem to work. Unless I’m doing something daft!

    I’ve tried adding the filter you suggested to the functions.php file in the child theme. That didn’t work. Although the previous filter for gallery images I used seems to be fine.

    I also changed the size of Large images in Settings>Media as suggested and regenerated thumbnails.

    No luck.

    Any other ideas? I’m really stuck.

    If it’s of help, I’ve attached FTP info in Private Content.

    Thanks

    Steve

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