Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Sometimes, a straightforward image gallery just won’t cut it. When you need to create a gallery with images from specific posts on your website, or you need to override the default WordPress gallery with the Envira gallery engine, you need a stronger tool. That’s why we created the Dynamic Addon, a feature that allows you to create dynamic galleries — and albums — on the fly.
When you want to be able to quickly create a gallery without re-uploading images, changing out data, and formatting the gallery layout, you can use the Dynamic Addon to save time.
This article will help walk you through the many ways in which you can quickly and easily create dynamic galleries.
Please follow our instructions on how to install and activate addons. In this instance, you’ll be activating the Envira Dynamic Addon.
First, navigate to your WordPress Admin Dashboard, then select the Envira Gallery tab. From the Envira Gallery plugin page, select the Envira Dynamic Gallery to edit the gallery. Envira Gallery automatically drafts this dynamic gallery for you when you activate the addon.
Now, you’ll need to establish your dynamic settings. Simply navigate through each tab of the gallery and create your base dynamic settings. Envira Gallery will apply these settings to all dynamic galleries you create.
Customizations you can make include Lightbox and mobile gallery settings, standalone options, general and miscellaneous configuration, and other options, depending on any other addons you may also be using.
Finally, you’ll just need to click Publish or Update on your gallery to save any changes you’ve made to your default dynamic gallery settings.
Once you’ve completed these steps for configuring dynamic galleries, you can repeat these same steps for creating dynamic albums if you’re using the Albums Addon.
You can also use the Dynamic Addon to create galleries from images in a number of different scenarios, including:
XXX
, this is only an example. ALL dynamic gallery ID names should always be unique each time it’s used or this could cause confusion and mixed results. The Dynamic Addon allows you to create Envira galleries from images already on a page, post or CPT. To create this type of dynamic gallery, you’ll first need to create a new page or post on your site from your WordPress Admin dashbaord.
Click the plus icon to add an Image block using WordPress’ Gutenberg editor, then click the Upload button to upload images to the page or post you’re creating. WordPress will only consider an image attached to a post if it’s uploaded to that post directly. In other words, if you simply select it from the Media Library, WordPress will not consider that image attached to the post.
Once you’ve uploaded your images, click Publish to launch the page or post.
In the browser bar for the page or post you’ve just made, you’ll see an ID number that WordPress has assigned. Note this number, as you’ll need it for your dynamic gallery.
Next, simply add the following shortcode to the page and click Update.
For example, if the URL shows this https://yoursite.com/wp-admin/post.php?post=62602&action=edit
, your dynamic shortcode would look like what’s shown below:
Shortcode:
[envira-gallery-dynamic id="62602"]
Template Tag:
envira_dynamic( array( 'id' => 62602 ) );
Now, when you visit the page or post, you’ll see your dynamic gallery.
Using a very similar process to the one above, you can create a dynamic gallery from specific images in your Media Library. Simply go to your WordPress Admin » Media » Library and find the image ID of the photo you want to add to your gallery by looking at the browser URL.
In this example, the URL while viewing the image we want to add is https://yoursite.com/wp-admin/upload.php?item=445707
. In this instance, the image ID is 445707. We’ll use this ID in the shortcode to create the dynamic gallery.
You can also install and activate the Show IDs plugin to see a list from the Media’s List view of the actual image ID in the ID column.
Now, just paste your shortcode into the page or post on which you want to create your dynamic gallery. Make sure to input the image ID:
Shortcode:
[envira-gallery-dynamic id="custom-XXX" images="600,601,602"]
Template Tag:
envira_dynamic( array( 'id' => 'custom-XXX', 'images' => '600,601,602' ) );
Creating this type of dynamic gallery is a little more technical than the others, because it requires access your server files directly by creating directories inside your /wp-content
directory.
If you don’t have prior experience with WordPress directories, it may be best to find an alternative option for creating this type of dynamic gallery.
Locate the folder in your /wp-content
directory that contains your image, or create a new one to hold the images. Then, use the shortcode below to create your dynamic gallery:
Shortcode:
[envira-gallery-dynamic id="folder-gallery"]
Template Tag:
envira_dynamic( array( 'id' => 'folder-gallery' ) );
Some important tips to remember:
folder-
in the example above. In our example, the folder is called gallery
, which is inside the wp-content
folder.wp-content
directory e.g. wp-content/gallery
. Subdirectories (wp-content/gallery/gallery
) will also work.This is likely the easiest dynamic gallery you can create. If you’ve spent countless hours setting up your WordPress galleries before you purchased Envira, you don’t want to have to recreate them all from scratch. We don’t want you to waste that kind of time, either, so we’ll show you how to override the default output to make them into Envira dynamic galleries using the Dynamic Addon.
To convert your WordPress galleries into Envira Dynamic galleries, just look for the option on the Configuration tab of the Envira Dyanmic Settings to Render all WordPress Galleries using Envira? Check this box, which will automatically take any WordPress gallery and change it to an Envira dynamic gallery using the settings from the Envira Dynamic Settings.
This is one of the easiest dynamic galleries to create because it doesn’t require any shortcode!
Note: Currently, this solution will not work if you created your WordPress galleries using the Gutenberg editor. It must have been created in the Classic editor to convert using this method.
You can also use the Dynamic Addon to convert your NextGEN galleries to Envira galleries without recreating them.
You can easily use the Envira NextGEN Importer Addon to import your NextGEN galleries, or you can create a dynamic gallery by adding a shortcode to your page using your NextGEN gallery’s ID number:
Shortcode:
[envira-gallery-dynamic id="nextgen-ID"]
Template Tag:
envira_dynamic( array( 'id' => 'nextgen-ID' ) );
Creating a tag-based dynamic gallery using Envira’s Tags Addon is probably the easiest way to achieve this solution. We have a more detailed article on how to Display a Tag Based Dynamic Gallery that you may also find helpful.
But, you can create this gallery using the Dynamic Addon, too. For example, let’s say you tagged some of your images with the tag food. You could paste the following shortcode into a page or post to display a dynamic gallery that includes all photos tagged food.
Shortcode:
[envira-gallery-dynamic id="tags-food"]
id="tags-
before you enter your tags. If you would like to add more than 1 tag in your gallery, you would separate the remaining tags with a comma, like this: [envira-gallery-dynamic id="tags-balloons,buildings"]
.The Dynamic Addon can also be used to create albums from:
To create a dynamic album that contains certain Envira galleries on your site, locate the gallery ID numbers of all the galleries you wish to include in the album.
If you’re not sure where to find your gallery ID number, check out our article on How do I find my Envira Gallery ID Number.
Once you know your gallery ID number, paste the shortcode below into your page or post, including your unique gallery ID. Just be sure to separate each gallery ID number with a comma (no spaces needed).
Shortcode:
[envira-album-dynamic id="custom-XXX" galleries="607,611"]
Template Tag:
envira_dynamic_album( array( 'id' => 'custom-XXX', 'galleries' => '607,611' ) );
If you wanted to create a dynamic album that shows all of your Envira galleries, use the following shortcode. Just be sure to keep the ID for the album unique.
Shortcode:
[envira-album-dynamic id="custom-XXX" galleries="all"]
Template Tag:
envira_dynamic_album( array( 'id' => 'custom-XXX', 'galleries' => 'all' ) );
Some important tips to remember:
A: Currently the only Pagination Type that can be used for Dynamic galleries is the On Pagination Click, reloading Page.
A: Currently the Watermark tab is unavailable for dynamic galleries. Envira does not currently have a way to confirm if images in dynamic galleries have been watermarked.
A: Dynamic galleries pulling from a folder will only look for images from the folder specified in the shortcode. It will not look into any subdirectories for additional images. If you want to pull images from a subdirectory, you will need to specify that subdirectory in the shortcode, like so: [envira-gallery-dynamic id="folder-gallery/subdirectory"]
.
A: For best practices when naming your dynamic shortcodes, it’s best not to use any characters that can be seen as possible code. Things like semi-colons, colons, commas or number signs should be avoided.
A: First, make sure that the Password Protection Addon is enabled.
Once you’ve enabled the addon, you can add the correct information to the Dynamic shortcode to password protect your galleries. You’ll be able to set a username or email using the password_protection_email
option and a password using the password
.
Here’s an example: [envira-gallery-dynamic id="410" password_protection_email="[email protected]" password="123"]
A: Transient cache may cause issues with images in dynamic galleries. Please follow the guide for Disabling the Fragment Cache.
A: Absolutely! You can follow along with these docs on categorizing your galleries, and then add your shortcode to any post, page or widget like this:
[envira-album-dynamic id="tags-featured-galleries"]
Just remember to change the tags-featured-galleries
to match the slug name of the category you chose for your galleries:
A: You can use the Albums Addon to create a dynamic album that pulls your latest galleries. Just add this shortcode to your page, and remember to change the name each time you want to use this type of shortcode.
[envira-album-dynamic id="custom=pulllatest5gals" limit="4" orderby="date" order="desc"]
The shortcode above pulls in the last 4 galleries, but you can change the number of galleries it pulls by setting a differentlimit
.
A: Absolutely! You’ll need to add a bit more to the shortcode to specify the image ID from the step above, and you’ll need to specify each URL for each image (in order), like this example:
[envira-gallery-dynamic id="custom-id-external-links-123" images="5272,5271,5270" external="https://www.apple.com/itunes/,https://www.shopdisney.com/,http://amazon.com"]
A: Unfortunately, the Dynamic Addon and the Videos Addon are not compatible at this time.