Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. fld-gallery
Core Lists

A photo gallery the client fills

fld-gallery="Gallery name"

A gallery field in the admin: the client adds photos from the media library, removes them and drags them into order.

Where it goes

On the block that holds the photos. The first photo is the pattern: the build repeats it for every image, with the image’s own src and alt.

A photo may sit in its own wrapper (<div><img></div>), as in the example, or come as bare <img> tags in a row, the way Webflow exports them.

The field appears in the admin only if the page has a group name: wp-fields-group on its <body>.

Example: photos of the café

Markup index.html
<div class="interior" fld-gallery="Interior photos">
  <div class="interior__item">
    <img src="images/room-1.jpg" alt="Window seats">
  </div>
  <div class="interior__item">
    <img src="images/room-2.jpg" alt="The bar">
  </div>
</div>
In the admin Pages → Home
Interior photos
Add to gallery
On the site after an edit
Inside Window seats The bar The garden

The photos are chosen in the admin.

What matters

  • “Load data” does not bring photos into a gallery: the client adds them in the admin.
  • Galleries are also protected from “Load data”: it never clears photos the client chose (the switch “Protect gallery fields on data import” in the theme settings, on by default).
  • For one picture use fld-image.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<img src="images/room-1.jpg" alt="Window seats"
     fld-gallery="Interior photos">

On an <img> the gallery does not work: the build logs the attribute, and the picture stays fixed.

Like this
<div fld-gallery="Interior photos">
  <div><img src="images/room-1.jpg" alt="Window seats"></div>
</div>

On the block that holds the photos.

The same in site settings or on a category
fld-galleryon a page or post
tax-galleryon a category or tag
Alternative spelling

f_gallery, t_gallery works the same: the build gives an identical theme.

Ready when you are

See your site’s WordPress admin before you pay.