Create Beautiful Responsive Photo & Video Galleries For Your Site in Minutes

Envira Gallery Blog

Digital Photography Tips, Tutorials and Resources

How to create dynamic galleries and albums in WordPress with Envira Gallery

How to Create Dynamic Galleries and Albums in WordPress (Step-by-Step)

Written By: author avatar Sherise Saavedra
author avatar Sherise Saavedra
Sherise is a Growth Writer at Envira Gallery. She’s been writing about WordPress, eCommerce, and content marketing since 2019. Before joining Envira Gallery, she was an Editor at WPBeginner and has written for several leading WordPress brands.
    

If your site has a “latest work” page, there’s a fair chance it’s a few shoots behind. Keeping galleries current usually means opening each one and adding new photos by hand, and that’s the step that slips on a busy week.

A dynamic gallery takes that step off your plate. You tag a photo or upload it to a post, and it shows up in the right gallery on its own.

The same idea works one level up, too, with albums that collect whole galleries without you ever editing them.

We set up both on a test site while writing this. Below, you’ll find how to create dynamic galleries in WordPress first, then dynamic albums, with the exact lines we used.

A dynamic image gallery in WordPress is a gallery that fills itself with images based on a rule you set, rather than requiring you to add each photo by hand.

Standard galleries need a trip to the gallery editor every time your library grows. Dynamic galleries skip that step. With Envira Gallery, the WordPress gallery plugin, the rule can be any of these:

  • Images attached to a post or page: every photo you uploaded to that post appears in the gallery.
  • Images with a tag: tag a photo in your Media Library and it joins every gallery that uses that tag.
  • A hand-picked set of images: you list the photos you want, without building a new gallery for them.

Once it’s set up, the gallery keeps up with your library. Upload a new photo and tag it, and it appears in every gallery connected to that tag.

That’s the real difference from a standard gallery. Instead of a fixed collection you curate by hand, a dynamic gallery always reflects your latest content.

Dynamic galleries solve problems that show up as a site grows. These are the situations where they make the biggest difference:

  • A growing photography portfolio: tag images by type (weddings, portraits, landscapes) as you upload them, and every gallery tied to that tag stays current.
  • A blog with photos in every post: a dynamic gallery can show every image attached to a post, which suits travel blogs, recipe sites and event coverage.
  • A shop with regular product shoots: a gallery tied to a product tag refreshes itself after each shoot, whether you add 5 images or 500.
  • A “best of” page: pull your favorite shots from several galleries into one place, without copying any photos.

If any of those sound like your site, the setup below is quicker than it looks.

What You Need for Dynamic Galleries and Albums

Dynamic galleries come from Envira’s Dynamic Addon, which is part of the Envira Gallery Pro plan and above. The free Lite version doesn’t include it.

Two other addons come into play depending on what you build. Tag-based galleries and category albums use the Tags Addon, which starts on the Plus plan, so Pro already includes it. Dynamic albums also need the Albums Addon, which is part of Pro.

You’ll also want a few photos or galleries already on your site, so there’s something for the rules to pull in.

Galleries and Albums That Update Themselves

Envira Pro includes the Dynamic, Albums and Tags addons, so new photos and new galleries land in the right place without any extra editing.

Follow these steps to set up your first dynamic gallery. The first two only happen once, and every dynamic gallery after that is a single line of text.

Step 1: Turn On the Dynamic Addon

If Envira isn’t on your site yet, download the plugin zip from your Envira Gallery account. Then install it from Plugins » Add New » Upload Plugin. The free version on WordPress.org is a good way to try Envira, but it doesn’t include dynamic galleries.

Next, go to Envira Gallery » Addons in your dashboard. Find the Dynamic Addon card, click Install, and then click Activate.

Envira Gallery Addons page with the Dynamic Addon card showing Status: Active

If you plan to build dynamic albums later in this guide, activate the Albums Addon before the Dynamic Addon. That’s when Envira creates the default album you’ll need. The Tags Addon on the same page powers tag-based galleries.

When you activate the Dynamic Addon, Envira creates a draft gallery called Envira Dynamic Gallery. You won’t place it on a page. Instead, its settings become the defaults for every dynamic gallery you create.

Go to Envira Gallery in your dashboard and open Envira Dynamic Gallery. On the Gallery tab, a short note confirms that this gallery’s settings are used as defaults.

Envira Dynamic Gallery edit screen with the note that its settings are the defaults for every dynamic gallery

Use the Configuration tab to pick your gallery layout and columns, and the Lightbox tab to set up the lightbox for your images. Click Publish to save these defaults.

Step 3: Choose Where the Photos Come From

You don’t build a dynamic gallery on a gallery screen. You describe it with a shortcode, which is a short line of text in square brackets that WordPress swaps for your gallery when the page loads.

You don’t need any coding knowledge for this. You copy one of the lines below and change a number or a word, and that one change decides which photos appear.

To show the images attached to a post, use the post’s ID number, which you’ll see in your browser bar while editing it (for example, post.php?post=1234):

[envira-gallery-dynamic id="1234"]

WordPress only counts an image as attached when you upload it to that post directly. An image you insert from the Media Library isn’t attached, so it won’t show up.

To show a hand-picked set of images, list their image ID numbers, separated by commas. You’ll find each ID in the browser bar when you open the image in your Media Library:

[envira-gallery-dynamic id="custom-highlights" images="600,601,602"]

Here, custom-highlights is just a name for this gallery. Envira’s docs ask for a different name each time, so two galleries never get mixed up.

To show every image with a tag, tag your photos first. Open an image from Media » Library, type a tag in the Envira Tags box, click Add, and then click Update. We added a “favorites” tag to eight images from three different galleries.

Media Library edit screen for an image with the favorites tag added in the Envira Tags box

Then put tags- in front of the tag name. To pull from several tags at once, separate them with commas, like tags-weddings,portraits. Our guide on tagging images in WordPress covers tags in more depth.

[envira-gallery-dynamic id="tags-favorites"]

Open the post or page where the gallery should appear. Click the + button, search for Shortcode, and add that block. Paste your line into it and click Publish or Update.

On our test site, the tag line above produced this My Favorites page. The photos came from three separate galleries, and we didn’t copy a single one.

My Favorites page showing a dynamic gallery of eight tagged images pulled from three different galleries

The same line works in the classic editor, in page builders that have a shortcode module, and in a sidebar. Here’s how to make shortcodes work in your sidebar widgets if yours doesn’t show it.

How to Create Dynamic Albums in WordPress

An album is a collection of galleries. Each gallery shows up as one cover photo, and visitors click a cover to open the gallery behind it. If the two blur together for you, here’s the difference between albums and galleries.

A dynamic album works like a dynamic gallery, just with whole galleries instead of single photos. You give it a rule, like “my three newest galleries,” and it keeps up as you publish new work.

It uses the same Dynamic Addon from Step 1, plus the Albums Addon. If you’d rather choose every cover and drag galleries into an exact order, a regular album is the better fit, and our photo album tutorial walks through it.

Set the Default Look for Your Dynamic Albums

With Albums active, Envira also creates a draft album called Envira Dynamic Album. Just like the gallery version, its settings are the starting point for every dynamic album.

Go to Envira Gallery » Albums and open Envira Dynamic Album. On the Galleries tab, you’ll see a note confirming that its settings are the defaults for your dynamic albums.

Envira Dynamic Album edit screen with the Dynamic Album Settings note explaining that its settings are the defaults for every dynamic album

Next, open the Configuration tab and choose how your albums should look. For our demo, we picked the Grid album layout with three columns, so every cover lines up in a neat row.

Configuration tab of the Envira Dynamic Album with the Grid album layout and Three Columns selected

Further down the same tab, we set gallery titles to show below each cover and turned on the image count. Click Publish to save these defaults.

Pick Which Galleries Go Into the Album

Dynamic albums use their own shortcode, envira-album-dynamic. To show your newest galleries, use this line:

[envira-album-dynamic id="custom-latest-work" limit="3" orderby="date" order="desc"]

In plain English, custom-latest-work is the album’s name, and limit is how many galleries to show. The last two values put the most recently published galleries first.

On our demo site, that line produced this Latest Work page. When you publish a new gallery, it takes the first spot and the oldest of the three drops off.

Latest Work page showing a dynamic album with the three newest galleries: Isometric Rooms, Dreamscapes and Characters

To show all your published galleries instead, use [envira-album-dynamic id="custom-all-work" galleries="all"].

For a hand-picked album, list gallery ID numbers separated by commas: [envira-album-dynamic id="custom-favorites" galleries="618,627,611"]. They appear in the order you type them, and this doc shows where to find your gallery ID number.

Build a Dynamic Album by Category

Category albums are our favorite kind, because sorting a new gallery takes one tick. With the Tags Addon active, every gallery edit screen gets an Envira Categories box in the right-hand column.

Open a gallery, tick a category in that box (or click + Add New Category to create one), and click Update. We added a Travel category to three galleries on our demo site.

Envira gallery edit screen for Mountain Escapes with the Travel category ticked in the Envira Categories box

Then use tags- followed by the category’s slug, which is the short, lowercase version of its name. So Travel becomes [envira-album-dynamic id="tags-travel"].

That one line gave us this Travel page. From now on, any gallery ticked as Travel joins the album, and nobody has to open the album again.

Travel page showing a dynamic album of three gallery covers, a city silhouette, a waterfall and a palm lake, each with its photo count

One thing we noticed in testing: category albums didn’t show the gallery titles, only each cover and its photo count. If names matter on that page, a short heading or caption above the album fills the gap.

You add a dynamic album to a page the same way as a gallery, with a Shortcode block. To help visitors find it, you can also add your album page to your WordPress menu.

Tips for Dynamic Galleries and Albums

A few habits make dynamic galleries and albums easier to live with once your library gets big. These are the ones worth keeping in mind:

  • Give every line its own name. Envira’s docs recommend a unique id each time, and they suggest avoiding colons, semicolons, commas and number signs in it.
  • Lead every gallery with your best photo, since a dynamic album uses each gallery’s first image as its cover.
  • Watermark before you upload. The Watermarking tab isn’t available for dynamic galleries, so protect those images another way.
  • Pick the right pagination type. Dynamic galleries only support “On Pagination Click, reloading Page,” per the Dynamic Addon documentation.
  • Keep videos in regular galleries. The Dynamic Addon and the Videos Addon don’t work together yet.

For a very large archive, it also helps to split one giant album into several category albums. Envira’s docs warn that an all-galleries album with several hundred galleries can slow the page down.

FAQs About WordPress Dynamic Galleries and Albums

Can I use dynamic galleries with page builders like Elementor or Divi?

Yes. Envira Gallery works with Elementor, SeedProd, Divi, Beaver Builder and other major WordPress page builders. Paste your dynamic gallery line into the builder’s shortcode module, and it displays the same way it does in the block editor.

Do I need to know code to use dynamic galleries and albums?

No. You copy one short line, change a name and a number or tag, and paste it into a Shortcode block. The look of every dynamic gallery and album comes from settings you pick with checkboxes and dropdowns.

Once your dynamic galleries and albums are in place, tagging a photo or publishing a gallery is the only step left. Be sure to check out our post on how to make a filterable gallery portfolio in WordPress.

Not using Envira Gallery yet? Get started today!

Don’t forget to follow us on Facebook and X (Twitter) for the best photography tips, resources, and WordPress tutorials.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how Envira Gallery is funded, why it matters, and how you can support us.

author avatar
Sherise Saavedra
Sherise is a Growth Writer at Envira Gallery. She’s been writing about WordPress, eCommerce, and content marketing since 2019. Before joining Envira Gallery, she was an Editor at WPBeginner and has written for several leading WordPress brands.

The Best Drag and Drop WordPress Gallery Plugin

Envira Gallery: Create, Showcase, and Sell Your Work – Trusted by 150k+ Sites.

Enter the URL of your WordPress website to install

Upgrade to Envira Gallery Pro

Unlock even more powerful features designed to make your galleries even more beaituful.

Video Galleries

eCommerce

Social media Sharing

Adobe Lightroom

And much more!

Popular on Envira Gallery Right Now!

How to Create a Beautiful Masonry Image Gallery in WordPress

How to Create a Beautiful Masonry Image Gallery in WordPress

Are you looking to showcase your photography or image collection…
Polished and Protected: How to Watermark WordPress Images

Polished and Protected: How to Watermark WordPress Images

Are you wondering how to add a watermark to images…

Add A Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Copyright © [#this year :%Y] Envira Gallery, LLC. Envira Gallery is a trademark of Envira Gallery, LLC.