WP Store Locator comes with the fields every location needs: address, phone, opening hours, and so on. If you need something extra, like parking availability, a “loyalty card accepted” flag, or a link to a franchise page, the Fields Manager lets you add it without writing PHP.
A new field doesn’t appear on the map or in the search results by itself, though — you also have to tell a template section where to render it. That second step happens in the Section Editor, which you can find under the same Fields Manager tab.
This guide walks through both steps: creating the fields, then adding them to a template. However, a dropdown field and a checkbox need one extra edit along the way.
Step 1: Create the fields
- Go to Store Locator > Settings > Fields Manager.
- Fields are organized into groups, and you need one before you can add a field:
- If you don’t have any groups yet, you’ll see an empty group name field. Enter Amenities and click Create Group.
- If you already have other groups, click Manage Groups, then + Add Group. A new, empty name field appears. Type Amenities into it, then click Return to Fields Manager. Back on the main screen, select Amenities from the group dropdown at the top of the section.
- Click + Add Field and fill in the first field:
– Label: Parking
– Field type: Dropdown
– Dropdown options: Street, Lot, Garage, None — one per line. - Click + Add Field again for the second field:
– Label: Loyalty card
– Field type: Checkbox - Click Save Changes.
Both fields now show up on every store’s edit screen, under the group you created them in — that’s where you fill in their value per store.
At this point the fields exist and have data, but neither is showing up anywhere on the front end yet.
Step 2: Generate the template code
- Still under Store Locator > Settings > Fields Manager, switch to the Section Editor sub-tab.
- At the top, choose the Template and the Section you want the field to appear in — List (the search results), Info window, or Number of results. You can repeat this whole process for more than one section if you want the field to show up in both the list and the info window, for example.
- Click Create Field Code. A dialog opens with:
– Field type — every available field, grouped the same way as in the Fields Manager, including your new one.
– Wrapper tag — optionally wrap the field in adiv,p,spanorstrong.
– CSS id / CSS class — optional, only shown once you pick a wrapper tag. - Select your field (and a wrapper tag, if you want one), then click Show Code. A preview appears, for example:
The
<% if ( parking ) { %> <p class="wpsl-parking"><%= parking %></p> <% } %> <% if %>check is added automatically, so the markup only renders for stores that actually have a value in that field. Dropdown, text, textarea, email, phone and URL fields print their value as-is this way (email, phone and URL go through the plugin’s own formatting helpers). The preview above is ready to copy as it is. Checkboxes are the one exception. For Loyalty card accepted, the preview has the same format, but isn’t as usable:<% if ( loyalty_card ) { %> <p class="wpsl-loyalty-card"><%= loyalty_card %></p> <% } %> A checkbox stores
1when it’s checked and nothing when it isn’t, there’s no label text behind it. Pasted as-is,<%= loyalty_card %>prints a literal “1” inside the output. The<% if %>check is still correct — it only shows the paragraph for stores where the box is checked — but replace the value on the line below it with your own text before you copy it:<% if ( loyalty_card ) { %> <p class="wpsl-loyalty-card">Loyalty card accepted</p> <% } %> - Click the copy icon to copy the snippet to your clipboard.
Step 3: Paste it into the template
- In the same Section Editor, click in the code editor and paste the snippet wherever you want it to render in the markup.
- Tick Activate this custom template section. Until this is checked, your saved code is stored but the section keeps using the default markup.
- Click Save Section.
This field is now live. Repeat Steps 2–3 for the other field, and repeat both steps again for any other section (info window, results count) you want a field to appear in.
A few things worth knowing
- A field with no value renders nothing. The
<% if %>wrapper means stores that haven’t filled in the field just don’t show that bit of markup, instead of showing it empty. - Changing a field later doesn’t update the template. Renaming a field or changing its type doesn’t touch template code you already pasted in. If you rename a field, you need to update (or regenerate and re-paste) any snippet that references it.
- This generates a starting point, not a locked-in result. The pasted snippet is plain markup and
<% %>template syntax in the section editor. Edit it by hand afterwards if you want different conditions, extra markup around it, or to combine it with other fields.