开发者

Wordpress Lightbox Gallery by post

开发者 https://www.devze.com 2022-12-09 02:54 出处:网络
how can I separate the gallery affected 开发者_如何学JAVAby the lightbox gallery plugin by per post basis?

how can I separate the gallery affected 开发者_如何学JAVAby the lightbox gallery plugin by per post basis?

Right now what's happening is say I have 2 posts. Post 1 has 3 images which I turn into a gallery Post 2 has 5 images which I turn into a gallery

Now when I click 1 of the images on post 1, it does open the lightbox gallery as expected. However, the total images says 1 of 8 and I'm able to loop through the images from Post 2 as well. How can I prevent that?

Thank you, Tee


Oh man, I just find the answer.

You need to do two steps. If you would like to handle galleries separately, add different class names into [gallery] and add codes as many as class names into lightbox-gallery.js.

  1. Edit lightbox-gallery.js and add some codes. Look at the comment of the file.
  2. Add a class into [gallery]. ex) [gallery class="gallery2"]

Tee

0

精彩评论

暂无评论...
验证码 换一张
取 消