Description
Deprecated: Bricks 2.5 and later include query markers natively in the Map (Leaflet) element. Use the built-in feature for new maps. This plugin stays available so that existing maps keep working: it is compatible with Bricks 2.5, including on pages that also use the native feature. See “How do I migrate to the native Bricks feature?” in the FAQ.
The Map (Leaflet) element of the Bricks theme (2.1+) has no query loop option, unlike its Google Map element. This plugin adds a “Query markers” panel to the Map (Leaflet) element: the first marker you set is used as a template and duplicated for every post of the query, with all dynamic data tags rendered in the context of each post.
Features:
- Location from two latitude / longitude custom fields (ACF, Meta Box, JetEngine, native custom fields…).
- Location from a single field: a text field containing “lat,lng”, an ACF OpenStreetMap field (ACF OpenStreetMap Field plugin), an ACF Google Map field, or a Meta Box OSM / Google Maps field.
- Any Bricks dynamic data tag in the marker popup (title, link, ACF fields…).
- Optional filter on a custom field, e.g. a “show on map” True/False field.
- Posts sharing the same location: merged into one marker with stacked popups, or spread on a small circle.
- Map automatically fitted to show all markers, unless you set a map center or a zoom level.
- Builder notice showing how many markers were found.
This plugin requires the Bricks theme, which is a commercial product. It is not affiliated with or endorsed by Bricks Builder.
Installation
- Install and activate the plugin.
- In Bricks, add a Map (Leaflet) element (not inside a query loop).
- In “Markers”, add ONE marker. It is the template used for every post. Set its Coordinates to {map_coords} (required).
The popup is optional and accepts any Bricks dynamic tag, for example:
{post_title}
Read more - Open the “Query markers” panel, enable “Generate markers from a query” and choose the post type, the location source (latitude + longitude fields, or a single location field) and the field names.
- Leave “Map center” and “Zoom level (Initial)” empty: the map is automatically fitted to show all markers. Set a zoom level to keep the map centered on the markers at that zoom, or a map center to control the view yourself.
FAQ
How do I migrate to the native Bricks feature?
Requires Bricks 2.5 or later.
- Open the page or template with your map in the builder.
- In the Map (Leaflet) element, set up the native query markers feature of Bricks with the same post type and location field (read Bricks documentation of more details).
- In the “Query markers” panel, untick “Generate markers from a query”.
- Check the map on the frontend.
Once all your maps are migrated, deactivate and delete this plugin. It stores no data: nothing is left behind.
Why are the markers not visible in the builder?
Markers are generated when the page is rendered and are displayed on the frontend. In the builder, a notice over the map shows how many markers were found.
Which dynamic tags are added?
{map_coords} returns “lat,lng” for the current post. It is the value to use in the marker Coordinates.
{map_address} returns the address stored by an ACF OpenStreetMap field (the label of its marker: the address found when the editor searched for a place or clicked on the map, which they can edit) or by an ACF Google Map field. With other fields it is empty: display your own address field in the popup instead (e.g. {acf_address}).
Outside a query map (e.g. in a single template), these tags read a single location field named “location”. Change it with the brxlm/default_context filter:
add_filter( 'brxlm/default_context', function ( $ctx ) {
$ctx['coords_field'] = 'my_location_field';
return $ctx;
} );
Does it work on multilingual sites?
Yes. With WPML or Polylang, the technical settings of the plugin (post type, field names…) are excluded from translation, so a translated page uses the same query as the original.
Which values does the single field accept?
- An ACF OpenStreetMap field (first marker) or an ACF Google Map field
- A Meta Box OSM or Google Maps field (“lat,lng,zoom”: the zoom is ignored)
- “43.2965,5.3698” or “43.2965, 5.3698” (comma separator, dot as decimal separator)
- “43.2965;5.3698” or “43.2965; 5.3698” (semicolon separator)
- “43,2965; 5,3698” (semicolon separator with decimal commas)
Ambiguous values such as “43,2965, 5,3698” are ignored: use a semicolon as separator when the decimal separator is a comma.
I can’t find my Meta Box OSM field in the Bricks dynamic data picker, is it normal?
Yes. The dynamic data picker lists the fields that Bricks itself can display as dynamic data, and some field types (such as the Meta Box OSM or ACF OpenStreetMap fields) are not listed.
The plugin lists them itself: with the “Single field” source, pick your field in “Map field (detected)” (ACF OpenStreetMap, ACF Google Map, Meta Box OSM and Meta Box Google Maps fields). For any other field, leave “Map field (detected)” empty and type its field ID in “Location field (meta key)”, which is then displayed: the plugin reads the stored value directly, so any field works.
If you pick a field with the dynamic data button, the tag is converted to the field name ({acf_my_field}, {cf_my_field}, {mb_post_type_my_field}).
Which field storages are supported?
Fields are read with the standard WordPress post meta functions. Fields stored in custom tables (e.g. Meta Box custom table storage) are not supported.
How are the map center and zoom handled?
- “Map center” and “Zoom level (Initial)” empty: the map is fitted to show all markers (never closer than street level, and within the map min/max zoom).
- Only the zoom level set: the map is centered on the markers, at that zoom.
- “Map center” set: your center is used, with your zoom level (or the Bricks default).
Can I customize the query?
Yes, with the brxlm/query_args filter:
add_filter( 'brxlm/query_args', function ( $args, $settings, $element ) {
$args['orderby'] = 'title';
return $args;
}, 10, 3 );
Screenshots




Changelog
1.2.0
- Deprecated: Bricks 2.5+ includes query markers natively. A note in the “Query markers” panel recommends the built-in feature for new maps (Bricks 2.5+ only). Existing maps keep working.
- Tested with Bricks 2.5 beta, including alongside the native feature.
1.1.0
- Location sources simplified: “Latitude + longitude fields” or “Single field”. The single field accepts text (“lat,lng”, “lat;lng”), ACF OpenStreetMap, ACF Google Map, Meta Box OSM and Meta Box Google Maps fields.
- Maps set up with the former “ACF OpenStreetMap field” source keep working.
- “Map field (detected)” setting: pick an ACF or Meta Box map field from a list.
- Map automatically fitted to all markers when “Map center” and “Zoom level (Initial)” are empty.
- Field name settings: a Meta Box tag picked with the dynamic data button (e.g. {mb_store_location}) is converted to the field ID.
1.0.0
- Initial release.
