This feature is available with an active Premier Subscription only.
Create a list of location pages, the Store Pages created by the Pages option of the Power add on, requires version 4.5 or later of the Power add on with the Pages option enabled.
Listing location pages is done by adding the [slp_pages] shortcode to your WordPress page or post. Only published Store Pages are shown. By default new pages created via the Manage Locations interface are created in ‘draft’ mode.
The [slp_pages] Shortcode
With not attributes set the [slp_pages] shortcode will create a list of all locations that contains the location name, address, and description.
You can modify the default CSS classes that are used for the list of pages div wrapper and well as individual page list wrappers.
An example inheriting Bootstrap 3.3 style CSS classes to format the layout:
[slp_pages style="full" no_map=”1” pages_directory_wrapper_css_class="row" pages_directory_entry_css_class="text-center col-xs-12"]
Only In Category
Adding the category attribute will filter the list to only show locations that are in the specified category. Categories are set using the categories feature of the Power add on. You must have created categories and assigned them to locations. You must use the category name, which is the “plain text” name such as “Wholesale Outlets” not the slug “wholesale-outlets”.
[slp_pages category="Wholesale Outlets"]
Limit How Many Locations To Show
By setting the max_locations attribute you can limit how many locations are returned in your pages list. By default all locations are listed. You can set max_locations=”-1″ to force all locations to be listed.
Filter By Featured or Not
Add the featured attribute to filter locations by whether or not they are marked as a featured location. Leave this setting out of the attribute list to list all locations matching the other attributes that have been set.
Show all featured locations:
Show only non-featured locations:
Filter By Location Attributes
For this feature to work you must be using Store Locator Plus® version 5.1 and Power version 5.1 or higher.
If you already created your Store Pages you will need to recreate all of the pages to ensure the full list of meta data is added to the pages. Start by deleting all of the pages via Store Locator Plus| Locations then selecting “Pages, Delete Permanently” and click the To All half of the Apply To All button. If you edited any of your Store Pages “by hand” after they were created using the default Store Page template those customizations will be lost, so make sure you copy those custom changes elsewhere if necessary. Now recreate the pages by choosing Pages, Create and click the To All button. If you go to Store Pages and edit any of the re-created pages you should be able to scroll down and see custom fields including the address, city, state, zip, and other fields. If you did not the process did not work.
Assuming you have newly-minted Store Pages with full attributes you can now use the custom fields filter described here.
To filter the list of pages to show only those locations in the state of Arkansas you can use the filter attribute. In this example we assume your state names were entered with full proper-case text as ‘Arkansas’ not the abbreviation AR. It is case sensitive.
You can perform partial matches as well using the WordPress meta query syntax for comparison operators and using the LIKE operator as such:
[slp_pages filter='state LIKE AR']
This will fetch any state with the letters AR in the name. LIKE is not case sensitive in these queries. This will pull places in Arkansas or Arizona and even Maryland.
Any of the operators allowed in WP_Meta_Query can be used including ‘=’, ‘!=’, ‘>’, ‘>=’, ‘<‘, ‘<=’, ‘LIKE’, ‘NOT LIKE’, ‘IN’, ‘NOT IN’, ‘BETWEEN’, ‘NOT BETWEEN’, ‘EXISTS’.
Stop Showing The Per-Location Map
Add the no_map=’1′ attribute.
Order Direction – Ascending|Descending
Adding the order attribute determines the ascending or descending order for sorting the list of pages. Set the value to ‘ascending’ (default) or ‘descending’. order=”a”, “asc” , “d”, “desc” will also work.
Adding the order_by attribute determines which element of the page should be used for sorting the list of pages. This option uses the WP_Query object to set the order by clause.
[slp_pages order_by="title" order="asc"]
Some of more useful options available include:
- ‘ID’ – Order by post id. Note the capitalization.
- ‘title’ – Order by title.
- ‘name’ – Order by post name (post slug).
- ‘date’ – Order by date.
- ‘rand’ – Random order.
- ‘menu_order’ – Order by Page Order. Used most often for Pages. The order field is set via edit pages in the Edit Page Attributes box.
The Style Attribute
The style attribute determines the layout for the list of locations. Default is ‘summary’ which shows the location name, address, and description.
When the style attribute is set to ‘full’ the output will be a list of location names with a heading tag followed by the full content as specified by the Store Pages page template.
When the style attribute is set to ‘list’ the output will be a bullet list of the location names.
This is the default mode if no style is specified.
When the style attribute is set to ‘summary’ the output will be a list of location names with a heading tag followed by the address and description.
You can specify a completely custom listing style including HTML and real-time data from your locations on the page listings. Use the style=”custom” and place the HTML between an [slp_pages] [/slp_pages] tag pair.
[slp_pages style="custom" featured="1"]
<h1 class="slp_pages title"><a href="[storepage post=permalink]">[storepage post=post_title]</a></h1>
<div class="ch-item">[storepage field='sl_image' type='image']</div>
<div class="righttext col-xs-12">
<h3><strong>[storepage field='sl_store'] </strong></h3>
<h4>[storepage field='sl_city'], [storepage field='sl_state'] [storepage field='sl_zip']</h4>
<div class="ch-info col-xs-12">
<h4 class="site-link">[storepage field='url' title='Visit Website' type='hyperlink']</h4>
<h4 class="info-link">[storepage field='pages_url' title='More Info' type='hyperlink']</h4>