Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #338934

    Hey!
    I upload most of my images at 1200px width so that when lightbox is activated you can see it at the same width than the site width.
    But indeed when you open an image in a lightbox it’s stretched to 1030px width.
    I’m using lightbox in different pages of the site.
    Is there a way to have images at 100% width when opened in a lighbox ?
    Thanks a lot.
    Cheers!
    Marie

    #339661

    Hey Marie!

    Try adding this to your theme / child theme functions.php:

    function change_lightbox_size() {
    	return "full";
    }
    add_filter('avf_avia_builder_helper_lightbox_size','change_lightbox_size', 10);

    Cheers!
    Josue

    #339930

    Works perfectly! Thanks a lot Josue!
    Cheers!

    Marie

    #339931

    Oops I talked too fast. It works perfectly but not for the portfolio grid (“Espace Media” page)….
    Thanks !
    Marie

    #340192

    Hi Marie,

    Open /enfold/config-templatebuilder/avia-shortcodes/portfolio.php and look for line 386:

    case "lightbox":  $link = wp_get_attachment_image_src(get_post_thumbnail_id($the_id), 'large'); $link = $link[0];	break;
    

    Replace it by this:

    case "lightbox":  $link = wp_get_attachment_image_src(get_post_thumbnail_id($the_id), 'full'); $link = $link[0];	break;
    

    Regards,
    Josue

    #340252

    For info this is NOT urgent at all…
    ———————————–

    Thank you for your feedback Josue!
    Gonna try that. Just wondering if I could rather put this line in my child theme so that I don’t have to change the enfold native file each time the theme is updated… but you would probably have told me… ? Just in case… let me know, and how (functions.php ? duplicate portfolio.php ?).

    Thank you again.
    Cheers,
    Marie

    #340302

    Hey!

    You don’t have to worry about that, in the next update the solution i provided here should work for the Portfolio too.

    Best regards,
    Josue

    #340484

    OK then thanks Josue!
    Made the change in /enfold/config-templatebuilder/avia-shortcodes/portfolio.php – line 386, and it works perfectly :)

    Thank you again.
    Regards,

    Marie

    #340671

    You are welcome Marie, glad to help :)

    Regards,
    Josue

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Lightbox width not set at 100% ?’ is closed to new replies.