Open image gallery on link click


I have a very simple wordpress problem, but I’m still struggling to figure out the solution. I have an anchor tag, and I want it to open an image gallery in a lightbox (as the default behavior when user clicks on one of the images from the image gallery) on click.

The image gallery should be hidden otherwise, visible only when the user clicks “show gallery” link.

Here’s the code:

<a href="#">View gallery</a>

Can someone help me please? How do I bind the two elements together? Is there any easy way like setting the class to the anchor tag and selector name to gallery tag (as X theme makes it easily done) or do I have to write the lightbox code from scratch? It would be highly appreciated.

, , , Janez Novak 4 years 2020-02-15T08:39:17-05:00 0 Answers 81 views 0

Leave an answer