Skip to content

Instantly share code, notes, and snippets.

@n7studios
Created September 15, 2015 15:33
Show Gist options
  • Save n7studios/d1705305f783603b8c86 to your computer and use it in GitHub Desktop.
Save n7studios/d1705305f783603b8c86 to your computer and use it in GitHub Desktop.
Envira Gallery - Load Lightbox from Link
<!--
1. Change data-envira-gallery-id to the Gallery ID you want to display
2. Ensure that Gallery is on the same page as the below link
3. Ensure the PHP file above is located in wp-content/plugins and activated via WordPress Admin > Plugins
-->
<a href="#" class="envirabox" data-envira-gallery-id="1234">Load Gallery in Lightbox</a>
@dyske
Copy link

dyske commented Nov 1, 2016

Perhaps Envira changed something; your code did not work for me. It would pop up the last image of the gallery, instead of the first. I had to do the following:

$('#envira-gallery-'+$(this).data('envira-gallery-id')+' > div:first-child a').envirabox().click();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment