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:
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>