Tagged: advanced-layout-editor, Images, Lightbox, Portfolio
-
AuthorPosts
-
October 28, 2014 at 3:56 pm #342277
Hi,
Is there a way for Enfold Lightbox to see all he images associated with the portfolio item, or just the images that are in the advanced layout editor?
At the moment they cycle through the images within a Colour Section only.
Also, I’d like to add images from a Full Width Easy Slider to the cycle, but this is less important (I’m using a large image at the top, but it’s a better solution than just Image item).Thanks for your help.
October 30, 2014 at 2:29 pm #343411Hey zohar!
Thank you for using Enfold.
Please add this at the very bottom of functions.php to grouped all linked images inside a lightbox:
function add_custom_script(){ ?> <script> (function($){ $(window).load(function() { $('.single-portfolio').magnificPopup({ delegate: 'a', type: 'image', mainClass: 'avia-popup mfp-zoom-in', gallery: { tPrev: '', tNext: '', tCounter: '%curr% / %total%', enabled: true, preload: [1,1] // Will preload 1 - before current, and 1 after the current image }, callbacks: { imageLoadComplete: function() { var self = this; setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16); } } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script');
I haven’t tested if the slider images will be included on the lightbox.
Best regards,
IsmaelOctober 30, 2014 at 3:21 pm #343435Hi Ismael, Thanks for your reply.
This solution works… partly.It now loads more images than I have actually associated to the post. 8 are uploaded but I see 80 in the list (15/80 for instance) and most of them show the message “the image could not be loaded”.
Finding it difficult to understand how it knows which images to use…
October 30, 2014 at 3:28 pm #343439I just noticed that navigation also now activates the lightbox (I think it’s anything with the ‘a’)
October 30, 2014 at 3:34 pm #343443Ok, found a solution – changing
delegate: 'a',
todelegate: 'a.avia_image',
was loading only the images associated with a lightbox. While not being all the images associated with the page, it’s a good enough solution for now. -
AuthorPosts
- The topic ‘Lightbox on all photos in portfolio item’ is closed to new replies.