Master Addons
  • Widgets
    • Changelogs
      Source Code NEW PRO
      Caldera Forms
      Logo Slider
      Table of Contents
      Gravity Forms
      Transforms PRO
      Restrict Content PRO
      Pricing Table
      Ninja Form
      Mailchimp
      Tooltip
      Popup Trigger NEW PRO
      Which Element NEW
      Creative Button
      Creative Links NEW
      Domain Search HOT PRO
      Dual Heading HOT
      Flipbox
      Animated Gradient BG HOT PRO
      Image Hotspot PRO
      Infobox
      News Ticker PRO
      Particles
      Progress Bar
      Off-Canvas Content NEW PRO
      Reading Progress Bar HOT
      Custom JS
      Blockquote
      Counter Up
      Image Hover Effects
      Reveal NEW PRO
      Rellax PRO
      Positioning
      Image Comparison
      Tabs
      Toggle Content HOT PRO
      Post/Page Duplicator FREE
      Floating Effects PRO
      Mega Menu HOT
      Custom CSS HOT
      Gradient Headline
      Advanced Image
      Nav Menu
      Tooltips
      Comparison Table PRO
      Glassmorphism
      Featured Product PRO
      Image Carousel
      Gallery Slider NEW PRO
      Dynamic Tags NEW
      Countdown Timer
      Current Time
      Patterns
      Wrapper Link
      Timeline
      Team Member
      Contact Form 7
      Advanced Accordion
      Animated Headlines
      Blog
      Business Hours
      Call To Action
      Progress Bars
      Background Slider
      Team Slider
      Dynamic Table
      Grid Line PRO
      WP Forms
      Search
      We Form
      Entrance Animation NEW PRO
      Display Conditions PRO
      Filterable Image Gallery
      WP Forms
      Custom Breakpoints NEW
  • Features
    • Theme Builder

      Design site-wide templates for a consistent look across every page of your website.

      Popup Builder

      Create engaging popups, modals, and announcement bars - to capture leads.

      Widget Builder

      Expand Elementor with advanced custom widgets to build more dynamic layouts.

      Mega Menu Builder

      Create multi-column menus with icons and images for superior navigation.

      Custom Css

      Apply your own CSS for pixel-perfect styling beyond default design options.

      Dynamic Tags

      Insert dynamic content like post titles and custom fields directly into designs.

      Display Conditions

      Control element visibility based on user role, device, time, and other rules.

      Icons Library

      Choose from thousands of built-in icons to enhance visuals and consistency.

      Animation

      Add scroll, hover, entrance, and much more animations to bring designs to life.
  • Template Kits
    • Template Kits

      Professionally designed full-page template Kit. Import and customize in seconds.

      Ready Sections

      Pre-built content sections and rows. Drag, drop, and customize instantly.

      Ready Popups

      Different types of High-converting popup designs. Import and launch quickly.

      Elementor Page Templates

      Complete page layouts for any purpose. Start editing immediately.

      Ready Header

      Multiple modern header designs. Import and adapt to your brand.

      Ready Footer

      Fully designed footers for different websites. Add functionality and style in clicks.
  • Brands
    • WP Adminify

      WP Adminify

      Take control of your WordPress dashboard. Customize the admin experience.
      Admin Bar Editor

      Admin Bar Editor

      Customize the WordPress admin bar for a cleaner, more personalized workspace.
      Loginfy

      Loginfy

      Customize your WordPress login page with branding, styles, and security enhancements.

      Rolemaster Suite

      Manage user roles and permissions with precision for better security and workflow.
      Master Blocks

      Master Blocks

      Expand the Gutenberg editor with advanced custom blocks for more creative layouts.
      WP Spotlight

      WP Spotlight

      Instantly search and access admin features, posts, and settings from anywhere.
  • Themes
  • Help
    • Get Support
    • Documentation
    • Facebook Community
    • Changelogs
  • Blog
Pricing
🇺🇸EN
  • 🇺🇸EN
  • 🇸🇦AR
  • 🇧🇩BN
  • 🇩🇰DA
  • 🇩🇪DE
  • 🇪🇸ES
  • 🇫🇷FR
  • 🇮🇳HI
  • 🇰🇷KO
  • 🇵🇹PT
  • 🇷🇺RU
  • 🇨🇳ZH

Getting Started

  • Can’t see the Master Addon Element inside Elementor Page editor?
  • How To Apply For an Affiliate Account?
  • Active Pro version
  • Installing Plugin

Addons

  • Popup Trigger Widget Settings
  • Off-Canvas Content Widget Settings
  • Logo Slider Widget Settings
  • Progress Bars Widget Settings
  • Image Carousel Settings
  • Featured Product Widget Settings
  • Comparison Table Widget Settings
  • Source Code Widget Settings
  • Advanced Image Widget Settings
  • Gradient Headline Widget Settings
  • Gallery Slider Settings
  • Toggle Content Widget Settings
  • Info Box Widget Settings
  • Timeline Widget Settings
  • Dynamic Table Widget Settings
  • Mailchimp Widget Settings
  • Blockquote Widget Settings
  • Changelog Widget Settings
  • Countdown Timer Widget Settings
  • Current Time Widget Settings
  • Search Widget Settings
  • Filterable Image Gallery
  • Team Slider Widget Settings
  • Counter Up Widget Settings
  • Restrict Content Settings
  • Table of Contents Widget Settings
  • Image Hotspot Widget Settings
  • Image Comparison Widget Settings
  • News Ticker Widget Settings
  • Image Hover Effects
  • Tabs Settings
  • Pricing Table Widget Settings
  • Nav Menu Widget Settings
  • Domain Search Widget Settings
  • Flipbox Widget Settings
  • Tooltip Settings
  • Creative Links Widget Settings
  • Business Hours Widget Settings
  • Contact Form 7 Widget Settings
  • Creative Button Widget Settings
  • Animated Headlines Settings
  • Advanced Accordion Widget Settings
  • Call to Action Widget Settings
  • Progress Bar Widget Settings
  • Blog Posts Widget Settings
  • Team Member Widget Settings
  • Dual Heading Settings

Extensions

  • Icon Library Settings
  • Mega Menu Settings
  • Which Element Extension Settings
  • Post/Page Duplicator Extension Settings
  • Grid Line Extension Settings
  • Glassmorphism Extension Settings
  • Tooltip Extension Settings
  • Wrapper Link Settings
  • Floating Effects Extension Settings
  • Dynamic Tags Settings
  • Display Conditions Extension Settings
  • Entrance Animation Settings
  • Custom Breakpoints Settings
  • Animated Gradient BG Extension Settings
  • Reveal Extension Settings
  • Particles Extension Settings
  • Background Slider Extension Settings
  • Transforms Extension Settings
  • Rellax Extension Settings
  • Positioning Extension Settings
  • Custom CSS Settings

Widget Builder

  • Conditions
  • Twig Syntax
  • Settings Panel Introduction
  • Divider
  • Text Shadow
  • Select2
  • Border
  • Heading
  • Tabs
  • Repeater
  • Visual Choice
  • Background
  • Dimensions
  • Box Shadow
  • Slider
  • Icons
  • Gallery
  • Media
  • Popover Toggle
  • URL Field
  • Date Time
  • Typography
  • Font
  • Color Field
  • Choose
  • Select
  • Switcher
  • Hidden
  • Code
  • WYSIWYG
  • Textarea Field
  • Number
  • Text Field

Theme Builder

  • Comment Form
  • 404
  • Search
  • Archive
  • Single
  • Footer
  • Header

Popup Builder

  • How to Open a Popup After Inactivity in Elementor
  • How to Show an Exit Intent Popup in Elementor
  • How to Open a Popup on Scroll to a Specific Element in Elementor
  • How to Open a Popup on Scroll in Elementor
  • How to Open a Popup on Click in Elementor
  • How to open a popup on page load?
  • Popup Settings & Options

Template Kit

  • How to Import Template Kits in Master Addons
  • How to Disable Elementor Default Fonts and Colors
  • Import Elementor Template Kits
View Categories
  • Home
  • Docs
  • Widget Builder
  • Gallery

Gallery

Roy Jemee
Updated on September 17, 2026

4 min read

The Gallery field lets editors pick a whole set of images at once for a custom widget built with the Master Addons Widget Builder. Your template loops over the set and prints one item per image, so the widget grows or shrinks with the number of photos. Use it for photo grids, portfolio walls, logo rows and image sliders.

Gallery is a Pro field. The free plugin includes a limited Widget Builder, and the full set of fields comes with Master Addons Pro.

Three-column photo grid built with the Widget Builder Gallery field showing six images

What the Gallery field does #

  • It adds a gallery box to your widget’s panel in Elementor. Editors choose several images from the Media Library in one go.
  • The images are stored as a list, in the order the editor arranged them. Each image has an id and a url.
  • Your template prints the list with a {% for %} loop.
  • Layout is up to your CSS. The loop prints the items and a grid or flex container arranges them.

If you haven’t built a widget yet, read the Widget Builder overview first.

Before you start #

  • WordPress with Elementor installed and active.
  • Master Addons for Elementor and Master Addons Pro, both active. The installation guide covers setup.
  • Some images in your Media Library.
  • A widget open in the Widget Builder. The example in this guide is a “Photo Grid” widget with a Gallery field named photos.

How to add a Gallery field #

  1. Go to Master Addons > Widget Builder and open your widget.
  2. On the Content tab, add a section, for example “Gallery”.
  3. Type gallery in the field search box on the left.
  4. Drag Gallery into the section. Its settings open in the left sidebar.
Gallery field found by searching gallery in the Master Addons Widget Builder and added to a Content section

Gallery field options explained #

Gallery field options with Label, Name, Description and Default Images with an Add Images button
  • Label is the text above the gallery box in Elementor, for example “Photos”.
  • Name is the field’s unique ID and the list you loop over, for example photos. Letters, numbers and underscores only.
  • Description appears under the control in Elementor.
  • Default Images has an Add Images button that adds a placeholder slot. Hover over a slot for a cross to remove it and a pencil to choose a real image for that slot.

In our tests, the images set under Default Images were not passed to Elementor. A new copy of the widget started with a single placeholder instead, which the loop read as two empty items. The template below skips those, so plan for editors to add their own images after dropping the widget on a page.

The common settings further down work as they do on other fields.

Loop over the images in your template #

A gallery is a list, so {{ photos }} on its own prints nothing useful. Loop over it and print each image inside the loop:

{% if photos %}
<div class="photo-grid">
  {% for img in photos %}
    {% if img.url %}
      <figure class="photo-cell">
        <img src="{{ img.url }}" alt="">
      </figure>
    {% endif %}
  {% endfor %}
</div>
{% endif %}
Widget HTML looping over the photos gallery with a for loop and an if check on each image URL
  • photos is the field’s Name. img is a name you choose for the current image in the loop.
  • {{ img.url }} is the image file URL and {{ img.id }} is its Media Library ID.
  • The outer {% if photos %} skips the whole grid when the gallery is empty.
  • The inner {% if img.url %} skips any item without a URL, such as the placeholder a new widget starts with.

Arrange the items in the CSS tab. This grid makes three equal columns and crops every photo to the same shape:

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-cell { margin: 0; overflow: hidden; border-radius: 12px; aspect-ratio: 4 / 3; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

Click Save Settings when you’re done.

Use the Gallery control in Elementor #

Add the widget to a page, or reload the editor if the page was already open. The gallery box shows how many images are selected and a thumbnail of each one. The trash icon clears the whole set.

Gallery control in the Elementor panel showing six selected images next to the rendered photo grid

Click the thumbnails to open the WordPress gallery window. Drag images to change their order, click Reverse order to flip it, use Add to gallery to pick more images, and click the cross on an image to remove it. Click Insert gallery to save the set. The grid updates in the same order.

WordPress Edit gallery window with six images, Reverse order and Insert gallery

Common use cases #

  • Photo and portfolio grids.
  • Logo walls for clients or partners.
  • Image sliders, with the loop printing one slide per image.
  • Before-and-after or product image sets inside a card.

Tips for working with the Gallery field #

  • Always wrap the markup in {% if img.url %} inside the loop, so a new widget doesn’t show empty image boxes.
  • Use aspect-ratio and object-fit: cover so photos of different sizes line up.
  • Let CSS decide the columns. A grid wraps any number of images without template changes.
  • Add an alt attribute. The loop gives you the image ID if you need to print a caption or alt text from another field.
  • For one image, use the Media field. For images that each need their own text or link, use the Repeater field.

Frequently Asked Questions #

Is the Gallery field free?

No. Gallery is one of the Pro fields in the Widget Builder, so Master Addons Pro has to be active before you can add it to a widget.

Why does {{ photos }} print nothing?

A gallery holds a list of images, so the token on its own has nothing useful to print. Loop over it with {% for img in photos %} and print {{ img.url }} inside the loop.

Why does a new widget show empty image boxes?

In our tests a new widget started with a placeholder item that the loop read as two entries without a URL. Add {% if img.url %} inside the loop so those are skipped, then add real images in Elementor.

Do my Default Images show up in Elementor?

Not in our tests. The images set under Default Images in the builder weren’t used, so editors need to add images in Elementor.

Can editors change the order of the images?

Yes. Clicking the thumbnails in Elementor opens the WordPress gallery window, where images can be dragged into a new order or reversed. The loop follows that order.

Wrapping up #

Add the Gallery field, loop over it with {% for %}, skip empty items with {% if img.url %}, and let a CSS grid handle the layout. Editors then add, remove and reorder images from Elementor. See the Twig syntax guide for more on loops and checks, and pricing for what each plan includes.

What are your Feelings

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on September 17, 2026
IconsMedia
Table of Contents
  • What the Gallery field does
  • Before you start
  • How to add a Gallery field
  • Gallery field options explained
  • Loop over the images in your template
  • Use the Gallery control in Elementor
  • Common use cases
  • Tips for working with the Gallery field
  • Frequently Asked Questions
    • Is the Gallery field free?
    • Why does {{ photos }} print nothing?
    • Why does a new widget show empty image boxes?
    • Do my Default Images show up in Elementor?
    • Can editors change the order of the images?
  • Wrapping up

Join 30,000+ Web Creators Who Trust Master Addons

Get all the premium widgets and templates you desire, built with clean code that keeps your site fast. Ditch the bloat, not the features.

Try Live Demo
Join The Community
Master Addons for Elementor
Master Addons Logo

80+ Premium Widgets & Lifetime Updates – Build Beyond Limits. An Exclusive Creation by Pixar Labs

Facebook-f Twitter Youtube Wordpress
Features
  • Template kits
  • Template Library
  • Widget Builder
  • Theme Builder
  • Mega Menu Builder
Support
  • Support Forum
  • Contact US
  • Join Community
  • Blog
  • Video Reviews
Resources
  • My Account
  • Changlogs
  • Documentation
  • Video Tutorials
  • Toolz.dev
Navigate
  • Apply for Affiliate
  • Terms of Use
  • Refund Policy
  • Privacy Policy
  • About Us