Using the Locations Map Shortcode
It is possible to create a map with pins from specific Locations in the database. We do this by using a WordPress shortcode, which looks like this:
[locations-map include="3257,3432"]
The shortcode requires 3 things to work:
- The name “locations-map,” as shown above.
- Include: A comma-separated list of Location IDs include in the map.
- Exclude: A comma-separated list of Location IDs exclude from the map.
- Each Location included must have a pin set on the “GPS Settings” field, or else it will not be displayed.
If neither include or exclude are set, the map will display all Locations that have GPS data.
How to Find the Location ID
There is an ID column on the Locations Edit Screen in the WordPress Admin. Find the Location you’re trying to include, and copy the ID from there.
Map Example
I’ve copied the IDs for Kiwanis and Rotary park, and included the shortcode below. If you’re viewing the front-end of the website, you should see a map with pins for each location.
KIWANIS & ROTARY PARK
Kiwanis Park
Rotary Park
ALL LOCATIONS
City Hall
Public Library
Growth Management Engineering
Growth Management Building Division
Growth Management Planning Division
Winter Haven Chamber of Commerce
Human Resources
Winter Haven Water Administration
City Hall Annex
Winter Haven Regional Airport
Winter Haven Water Customer Service
Chain O’ Lakes Complex
Kiwanis Park
Winter Haven Recreational & Cultural Center
Rotary Park
Winter Haven Water Customer Service Payments
DiamondPlex Softball Complex
Winter Haven Police Department
Nora Mayo Hall – Purchasing
Fire Safety Complex
Cemeteries Office
Rolling Hills Cemetery
Lakeside Memorial Park
Chris Brown Cemetery
Oaklawn Cemetery
City Hall Annex – Technology Services
“Rowdy” Gaines Olympic Pool
Nora Mayo Hall
AdventHealth Fieldhouse & Conference Center
South Lake Howard Nature Park
EXCLUDED LOCATIONS
City Hall
Public Library
Winter Haven Chamber of Commerce
Human Resources
Winter Haven Water Administration
Winter Haven Water Customer Service
Chain O’ Lakes Complex
Kiwanis Park
Winter Haven Recreational & Cultural Center
Rotary Park
Winter Haven Water Customer Service Payments
DiamondPlex Softball Complex
Winter Haven Police Department
Nora Mayo Hall – Purchasing
Fire Safety Complex
Cemeteries Office
Rolling Hills Cemetery
Lakeside Memorial Park
Chris Brown Cemetery
Oaklawn Cemetery
City Hall Annex – Technology Services
“Rowdy” Gaines Olympic Pool
Nora Mayo Hall
AdventHealth Fieldhouse & Conference Center
South Lake Howard Nature Park