Gallery Shortcode
The shortcode [immomakler_gallery] lets you embed the image gallery of a property on any WordPress page or post. The shortcode uses the shared gallery library (Swiper + Lightgallery) and supports several preconfigured layouts (presets).
Basic usage
Section titled “Basic usage”On a property detail page the shortcode works without any arguments — the property is automatically derived from the current post:
[immomakler_gallery]Outside the detail page you must specify the property explicitly — either via the external reference number (property_id) or the WordPress post ID (post_id):
[immomakler_gallery property_id="ABC-123"][immomakler_gallery post_id="42"]Attributes
Section titled “Attributes”| Attribute | Values | Default | Description |
|---|---|---|---|
property_id | external reference number (objektnr_extern) | — | Selects the property via objektnr_extern from the Property_Post_Type. |
post_id | WordPress post ID (integer) | — | Direct WordPress post (overrides property_id). |
source | all, floorplans, non_floorplans | all | Filters the image selection by the gruppe meta field (GRUNDRISS). |
preset | registered preset ID | horizontal_thumbs | Selects the gallery layout. Built-in presets: horizontal_thumbs, vertical_thumbs. Custom presets can be registered via the action hook immomakler_gallery_register_presets. |
All remaining attributes are passed as options to the active preset. Boolean-like values (true/false/yes/no/1/0/on/off) and numeric values are automatically converted to the appropriate PHP type.
One of these options is image_click — it determines what a click on a photo triggers: lightbox (default, opens the full-size view over the page), permalink (leads to the property’s detail page), or none (not clickable). permalink is intended for galleries in a property list.
Examples
Section titled “Examples”Gallery of the current property with vertical thumbnails
Section titled “Gallery of the current property with vertical thumbnails”[immomakler_gallery preset="vertical_thumbs"]Show floor plans only
Section titled “Show floor plans only”[immomakler_gallery source="floorplans"]Images only (no floor plans), without thumbnails
Section titled “Images only (no floor plans), without thumbnails”[immomakler_gallery source="non_floorplans" show_thumbs="false"]Embed a gallery on a landing page
Section titled “Embed a gallery on a landing page”[immomakler_gallery property_id="OBJ-2026-007" preset="vertical_thumbs"]Clicking a photo leads to the property
Section titled “Clicking a photo leads to the property”[immomakler_gallery image_click="permalink"]Technical background
Section titled “Technical background”The shortcode is a thin wrapper around \ImmoMakler\Frontend\Gallery\Gallery_Service. It resolves the property, retrieves the images via the Image_Source_Resolver, merges the caller options with the preset defaults, and passes the result to the preset’s render() method.
Further customisation options — filter hooks for the image selection, the options array and the lightbox, as well as CSS variables for individual styling — can be found under Gallery Library: Customising.