Skip to the document
DocsThe media library

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 #

WhereWhat to use
Block editorThe Folder gallery block (vergelabs/folder-gallery)
ElementorThe Folder gallery widget
DiviThe Folder gallery module
WPBakeryThe 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"]
AttributeDefaultValues
folder0Term id of the folder
columns3Any positive integer
limit00 for no limit
sizelargeAny registered image size
link_tononenone, file, attachment, lightbox
layoutgridgrid, carousel
order_bynamename, newest, oldest, manual
childrenyesyes 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:

AttributeTypeDefault
folderinteger0
taxonomystringyour first folder taxonomy
columnsinteger3
limitinteger0
sizestringlarge
linkTostringnone
layoutstringgrid
orderBystringname
childrenbooleantrue

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:

ParameterExample
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