Skip to content

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).

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"]
AttributeValuesDefaultDescription
property_idexternal reference number (objektnr_extern)—Selects the property via objektnr_extern from the Property_Post_Type.
post_idWordPress post ID (integer)—Direct WordPress post (overrides property_id).
sourceall, floorplans, non_floorplansallFilters the image selection by the gruppe meta field (GRUNDRISS).
presetregistered preset IDhorizontal_thumbsSelects 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.

Section titled “Gallery of the current property with vertical thumbnails”
[immomakler_gallery preset="vertical_thumbs"]
[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"]
[immomakler_gallery property_id="OBJ-2026-007" preset="vertical_thumbs"]
[immomakler_gallery image_click="permalink"]

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.