Shortcodes

The Cardinal Store Locator plugin currently provides two shortcodes for embedding the store locator markup in a post or page. You do not need to use a shortcode in order to display the store locator and can instead opt to put the full markup in one of your theme’s template files or use the do_shortcode function to call the shortcode outside of the post/page content.

cardinal-storelocator

The primary store locator shortcode that will render all of the store locator markup. This shortcode accepts one “filters” attribute, which can be used to disable the filter output if you’re wanting to place the filters in a different location (used in combination with the filters shortcode below).

cardinal-storelocator-filters

The store locator shortcode that will render only the filters markup. This shortcode should be used when you’re wanting to place the filter markup in a different location (example: to the right or left of the locator) instead of the default. Use the main store locator shortcode with the filters attribute set to false:

in combination with the filters shortcode wherever you want the filters to appear:

cardinal-storelocator-single-map

The single map shortcode is intended for use on a single location page when using the default custom post type or an alternative custom post type for your locations (data source setting). It will render a map with the location that’s being viewed as a single marker.

Using shortcodes in PHP templates

To use the shortcodes in a PHP template file you can use the following code for the primary shortcode:

Code example for the filters shortcode: