Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1115693

    i have on one page in different containers image links with lightbox linking – others have a manual link to a Youtube video with iframe=true.
    How can I prevent that in the “Lightbox” these two different approaches unite in a gallery?

    The reason for this is clear – I want to prevent someone who comes into the lightbox via an image from being able to call the youtube video via the next button without having agreed to the GDPR conditions.

    Edit: i know if these different links are in different color-sections – there was no gallery mix. But that is not allways possible.


    Hey Guenter,

    You can add a different class to the galley and init lightbox for this class separately.

    Maybe something like this

    Best regards,


    But how to influence ( hook to ) the enfold lightboxes – not the inline popups.

    by the way – you see the link in private content. This is no gallery from the start. There are on that page different media files which have all a lightbox link.
    The default enfold way on the alb to have lightbox.
    I want to avoid that all media files are part of the “gallery” in the lightbox by clicking the next (or prev.) Button. On default Enfold behavior it is different Media files in different color-section are not part of one lightbox gallery.

    So is there a way to split in a layout without color-sections f.e. videos in one lightbox – images in the other?


    Hi Guenni007,

    I meant something like this.

    Well, you’ll need to add separate groups to every image element.

    Best regards,


    thanks for the hint :
    my solution now is ( because the youtube links : images with link to youtube films with iframe=true) have on lightbox-added the additional class: mfp-iframe i can do it this way:
    1) i gave the data-group to lightbox-added – then to mfp-iframe – so they got different data-groups
    2) and i had to add the main-class to magnific popup uses on enfold case to work properly
    3) i have to do it with window load not document ready

    // custom lightbox
    function add_custom_script_lightbox(){
    	$(window).load(function() {
                    $('.lightbox-added').attr('data-group', '1');
    		$('.mfp-iframe').attr('data-group', '2');
    		var groups = {};
    		$('.lightbox-added').each(function() {
    		  var id = parseInt($(this).attr('data-group'), 10);
    		  if(!groups[id]) {
    		    groups[id] = [];
    		  groups[id].push( this );
    		$.each(groups, function() {
    		      type: 'image',
    		      mainClass: 'avia-popup mfp-zoom-in mfp-image-loaded',
    		      closeOnContentClick: false,
    		      closeBtnInside: false,
    		      gallery: { enabled:true }
    add_action('wp_footer', 'add_custom_script_lightbox');

    Hi Guenni007,

    Thank you for sharing!

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,


    no you can close it now


    Hi Guenni007,

    Hope the solution will serve future generations :)

    Best regards,

    • This reply was modified 8 months, 3 weeks ago by  Victoria.
Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘lightbox galleries’ is closed to new replies.