Black Friday & Cyber Monday
50% OFF All plans, upgrades & renewals
View offers

SHORTCODES

Single Location shortcode reference

Display a saved GEO my WP location with the Single Location shortcode, supported attributes, map options and practical examples.

3 min read · Updated December 1, 2026

Use gmw_single_location to display one supported object's saved GEO my WP location. This is separate from a directory form ID. The examples use WordPress post ID 123.

[gmw_single_location object="post" object_id="123" elements="title,address,map,directions_link"]

Identify the object

Attribute Meaning
object Supported object adapter, such as post or bp_member. Its component/extension must be available.
object_id The content/member object's ID, not the directory form ID or location-row ID. When omitted, supported adapters try their current page context.
elements Comma-separated output elements in the order you want them.
element_id A unique identifier for this shortcode instance. One is generated when omitted.

The post adapter defaults to title, address, map, distance, location_meta and directions_link. Available elements depend on the adapter and data. A missing/unsupported adapter or object cannot produce a normal saved-location display.

Address, distance and content

address_fields selects supported address parts; the default address uses the saved address output. disable_linked_address="1" turns off the address link. location_meta selects supported saved contact/meta details.

units="imperial" uses miles; metric uses kilometers. Distance needs a search/visitor origin. Selecting distance does not request browser permission or assign a visitor location by itself.

no_location_message supplies text for an object without a saved location. Keep it simple: the shortcode's value cleanup removes quotes and normalizes several attributes. It is not a rich-content editor.

Map attributes

Use map_width (default 100%), map_height (300px), map_type (ROADMAP), zoom_level (13), scrollwheel_map_zoom and expand_map_on_load. Dimensions use CSS units; a fixed height is easy to verify.

map_icon_url / map_icon_size configure the object's icon; user_map_icon_url / user_map_icon_size configure the origin icon. Icon sizes use comma-separated numeric dimensions. info_window selects supported object detail elements; user_info_window supplies origin text. Provider and marker implementation limits apply.

Directions and wrapper options

directions_link is an output element for an outbound directions link. The base class also defines directions_form and directions_panel elements for supported live-direction workflows. Their availability depends on provider and output context; adding an element does not configure missing service credentials.

directions_form_units defaults to the site's configured behavior. element_width, css_class and css_id control the wrapper. Use unique CSS IDs when displaying more than one instance.

Post and member aliases

The Posts Locator alias accepts post_id:

[gmw_post_location post_id="123" elements="address,map"]

Prefer object and object_id in new generic examples. Older item_type/item_id attributes are deprecated. Do not use use_generic_location for a real public location: it is intended for sample/editor output.

Verify before publishing

Test a known object with a saved location, an object without one and the intended signed-out page. Check contextual IDs carefully inside loops and page-builder previews. Public output should contain only location details intended for visitors.