Map block

The LH Places Map block (lh-places/map, in the Embed category) draws geo-tagged posts on a Leaflet map. It is rendered on the server, works from any post type, and supports wide and full alignment. Each marker’s popup links to its post and shows its address.

SettingDefaultWhat it does
Post typepostOne or more post type slugs, comma-separated. Left blank, every post type is searched.
Post statuspublishOne or more statuses, comma-separated. Custom statuses work. Only statuses the current viewer can see are used (see below).
Posts10How many posts to plot.
CategorynoneCategory ID.
Post parentnoneOnly children of this post.
Specific postsnoneComma-separated post IDs.
Height400pxAny CSS height. The width always fills the container.
Zoom13The exact zoom for a single place. With several places the map first fits them all, and only zooms out further than this if it has to.
LayerstreetStarting layer, street or satellite. Viewers can switch between them.
Show numbered listonWith several places, numbers the markers and lists the posts below the map. The list works without JavaScript.

Which statuses are shown

Since 1.30.3 the Post status setting is filtered for whoever is viewing the page. A status is used when it is public for that viewer. The LH status plugins (lh-membership, lh-restricted-post-status and others) make their statuses public only for people allowed to see them, so a map set to publish,member shows member posts to members and only published posts to everyone else. private is used only for users who can read private posts. Draft, pending, scheduled, trashed and unregistered statuses are never shown. If none of the listed statuses is visible to the viewer, the map renders nothing rather than falling back to published posts.

Street tiles come from OpenStreetMap and satellite tiles from Esri World Imagery, so no API key is needed. In the editor preview, a block that matches no posts shows a placeholder explaining why. On the public site it renders nothing.

The [lh_places_geomap] and [lh_places_geojson] shortcodes were removed in 1.24. Use this block, or the REST API for raw GeoJSON.