Screenshots use sample data and English labels. Follow the translated instructions on this page; your theme, language, permissions and license can change the available controls. Select an image to view it at full size.
Gallery field: builder settings, storage key and validation options.Gallery field: sample controls in the content editor.
What it doesStores multiple attachment IDs with thumbnails.
Use it whenGalleries, image collections, product images or portfolios.
How to configureSelect Gallery. Editors can choose multiple Media Library images and remove individual items.
Saved asAn array of attachment IDs.
EXAMPLE
Portfolio Images
[123, 145, 188]
Read a Gallery Field in PHP
Use the field Key from the builder as the second argument of get_post_meta(). Escape or sanitize the value for its final output context.
Important: a Gallery field stores an array of attachment IDs. Loop through the IDs and use WordPress attachment functions to obtain the image HTML or URL. Security: Escape the value for its output context; do not print unescaped post meta directly into HTML.