Curly Quotes In WordPress Shortcodes

WordPress blog posts likes to use curly quotes instead of straight quotes whenever you write an article.     Our documentation site is built on WordPress which means many of our articles are replaced any quotes we type in an article with curly quotes.

The problem is that the WordPress shortcode processor does NOT like curly quotes.   If you use curly quotes in a shortcode attribute such as [slp_directory by=”city”] and those quotes are “curly”, WordPress treats the quotes as a plain-old alphabetic character just like the C-I-T or Y in “city”.   In other words WordPress things you mean “by quote-city-quote” not “by city”.

Why is that an issue?

If you copy-and-paste most examples from this documentation site WordPress will copy the “pretty curly quotes” into your shortcode.     If you paste that into your WordPress page it breaks.

Straight versus curly quotes when pasted into a page.

An example of how this can impact Store Locator Plus can be seen from my example where I pasted the slp_directory shortcode directly from the docs site into my test site.    I get an invalid data query because WordPress added curly-quotes to my data field name.    The SLP database does not have a field name quotesl_storequote but does have a field named sl_store.

The fix?

Make sure you re-type each quote manually.  Typing the ” in your blog instead of copy-and-paste will ensure you are getting “straight quotes” in your shortcode attributes not curly quotes.

This is how the example looks now that the curly quotes have been replaced with straight quotes.

Q. What is the difference between a shortcode and locator layout settings?

A.    A shortcode is a WordPress-specific code that lets you do nifty things with very little effort.  Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line.   In other words, a Shortcode = shortcut. Continue reading “Q. What is the difference between a shortcode and locator layout settings?”

Directory City/State/Country Filters

The directory feature of the Power add on allows you to quickly build a directory-style listing on your pages to show a list of cities, states, or countries where you have locations.

The [slp_directory] shortcode used to build this listing can be combined with a landing_page attribute to quickly refer your site visitors to an interactive map showing your locations in the selected city, state, or country.
Continue reading “Directory City/State/Country Filters”

Additional Layout Shortcodes with Power Add-on

 

If you have the Power Add-on in addition to the Experience Add-on you have additional fields that can be displayed with the use of shortcodes and attributes.

Contact Fields

The Power Add-on has Contact Fields that can be associated with your locations for adding internal special  ids  for updates or to add filters. The contact fields will not automatically appear in your results on the front end.
Continue reading “Additional Layout Shortcodes with Power Add-on”

The Store Page [storepage] Shortcode

The [storepage] shortcode is used by the Pages and Power add ons to render live location data on a location (store) page.     The template is set under the Pages / Settings tab in the Initial Page Features group via the Page Template setting.

The [storepage] Shortcode

By default the [storepage] shortcode does not output any content.   You need to use one of the following attributes to generate location-specific output.

The Field Attribute

The field attribute is used to output location data fields from the current active location linked to the page.   The field names should be the field slug.  They slug is not case sensitive.    By default a slug is the field name in lowercase with no spaces.

This will also set the field name used for some of the other attributes.   Thus is is important to list this first if using some attributes such as the “type” attribute.

[storepage field=store] will output the name of the location.
Continue reading “The Store Page [storepage] Shortcode”

Results Layout Shortcodes and Attributes

The ability to change results layout is included in the Experience add on.

Default Format

The default format for the results string uses the numerical encoding for the various data elements that can be rendered.   This default string format is present in the base Store Locator Plus plugin.  You can reset  to the default at any time by deleting the entry in the Results Layout field under  Settings/Results/Appearance and saving the settings.
Continue reading “Results Layout Shortcodes and Attributes”

Search Layout Shortcodes and Attributes

You must have the Experience Add-on   to change the Search Layout appearance, and along with other add-ons,  also allow you to to use the shortcode on  SLP WP page.

These  shortcodes only apply to the Search Layout admin setting when you have the appropriate  Add-on installed and activated.

slp_search_element

This shortcode provides a simple mechanism to place standard search form elements on a custom search form layout, including the wrapping divs and classes around labels and input fields.

button Attribute

Places a search form button on the search form.

Continue reading “Search Layout Shortcodes and Attributes”