WordPress, separate lightbox for separate galleries on the same page

I use WordPress 4.2.2, Lightbox Plux Colorbox plugin, tabs plugin and native gallery.

I have a single page with 2 tabs. Each of the tabs contains its own gallery like that:

Read More
[tab title="Tab 1"]
    
[/tab]

[tab title="Tab 2"]
    
[/tab]

When I click on a thumbnail, lightbox pops up and it has all 10 pictures in it, despite that the gallery has only 5. The problem is that the pictures from both galleries appear in the same lightbox.

How can I have separate lightboxes for each gallery?

Related posts

1 comment

  1. Thanks for your massive support, folks.
    I solved the issue myself with this little js hack:

    <script type="text/javascript">   
    $ = jQuery;
    $(function(){
      $('li.tab-pane').each(function(i, obj) {
        var uid = $(this).attr('id');
        $('#'+uid).find('a').attr('rel', 'lightbox['+uid+']');
      });
    });
    </script>
    

Comments are closed.