Galleries from folders
A folder can be a gallery. Point at the folder rather than at a list of files, and the page stays current: drop a new image into the folder and every page using that gallery has it, with nothing re-edited.
WordPress's own gallery block freezes a list of image ids at the moment you insert it. That is the difference, and it is the whole feature.
Four ways to place one #
| Where | What to use |
|---|---|
| Block editor | The Folder gallery block (vergelabs/folder-gallery) |
| Elementor | The Folder gallery widget |
| Divi | The Folder gallery module |
| WPBakery | The Folder gallery element |
| Anywhere | [vergeml_gallery folder="12"] |
They are not four galleries. All of them render through the same function, so whatever you fix or style once is fixed and styled everywhere.
Shortcode #
[vergeml_gallery folder="12" columns="4" layout="carousel" link_to="lightbox"]
| Attribute | Default | Values |
|---|---|---|
folder | 0 | Term id of the folder |
columns | 3 | Any positive integer |
limit | 0 | 0 for no limit |
size | large | Any registered image size |
link_to | none | none, file, attachment, lightbox |
layout | grid | grid, carousel |
order_by | name | name, newest, oldest, manual |
children | yes | yes includes sub-folder contents |
order_by maps onto ordinary WP_Query ordering: name → title ascending,
newest → date descending, oldest → date ascending, manual → menu_order,
which is the order you dragged files into in the library.
Block attributes #
The block takes the same options under camelCase names, plus one more:
| Attribute | Type | Default |
|---|---|---|
folder | integer | 0 |
taxonomy | string | your first folder taxonomy |
columns | integer | 3 |
limit | integer | 0 |
size | string | large |
linkTo | string | none |
layout | string | grid |
orderBy | string | name |
children | boolean | true |
taxonomy is what lets a gallery be drawn from a Clients tree while the rest of
the site uses Media Categories.
Assets #
The carousel and lightbox scripts are enqueued only on pages that contain a gallery. A page without one loads nothing.
The core shortcodes, extended #
The old [gallery] and [playlist] shortcodes gain extra parameters:
| Parameter | Example |
|---|---|
media_category — or any taxonomy you assign | [gallery media_category="products"] |
monthnum | [gallery monthnum="9"] |
year | [gallery year="2026"] |
limit | [gallery media_category="products" limit="12"] |
This is off by default and switched on with Enhance media shortcodes under Settings → Library settings, because it changes the behaviour of a core shortcode and that should be a choice.
REST #
The gallery editor reads the folder list through GET /wp-json/vergeml/v1/gallery-folders,
which requires upload_files. See the REST API reference.
Written from version 3.15.0 of the plugin. Last updated 2026-10-02. All documentation · Legal · Support