Tagged: Lightbox
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
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
Works perfectly! Thanks a lot Josue!
Cheers!
Marie
Oops I talked too fast. It works perfectly but not for the portfolio grid (“Espace Media” page)….
Thanks !
Marie
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
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
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
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
You are welcome Marie, glad to help :)
Regards,
Josue