Load a Custom Store Locator Template

If you want to make small modifications to the existing store locator template, or create a completely new one, then it’s a good idea to load the template from an external folder. This ensures that you won’t lose your template after you upgrade the plugin.

You can find the existing store locator templates in the /wp-content/plugins/wp-store-locator/frontend/templates folder.
  1. Create a wpsl-templates folder inside your active theme folder.
  2. Inside the wpsl-templates folder create a new file called custom.php.
  3. Copy the code from either the Default, or Show the store list below the map template, paste it in the custom.php and modify it to your needs.
  4. Place the following code in the functions.php in your active theme folder. This will load the custom.php template from the wpsl-templates folder in your theme folder.

Activate the Template

Go to Store Locator > Settings, scroll down to the “User Experience” section, look for the “Store Locator template” dropdown, select “Custom template” and save the changes.

Select Store Locator Template

If the selected template isn’t used, then make sure that no template is set through the [wpsl] shortcode. If this is the case, then it will always overwrite the selection you make on the settings page.