wpsl_listing_template

  1. Description
  2. Usage
  3. Changelog
  4. Source File
  5. Related

Description

This filter allows you to modify the HTML structure and add additional data to the store listing template.

Usage

In this example the data from a custom field called “my_textinput” is added after the address details:

The <% ... %> and <%= ... %> code is used by the Underscore library to execute JS code, and to print the correct JSON data when the HTML template is rendered.
If the changes you made don't show up on the frontend, then make sure to flush the store locator transient cache. You can do this on the settings page.

Change the Search Results Template Based on the Used Page

If your using the store locator on different pages, and you’d like to format the search results in a different way on some pages, then you can do so by using is_page in the template code.

Replace ‘your-page’ with any of the accepted parameters for is_page.

Make Different Data Clickable

The code examples below show how to make additional URL, phone or email data clickable in the template.

Changelog

Since 2.0

Source File

This filter is located in /frontend/underscore-functions.php.

Placement

The code needs to be placed in the functions.php file inside your active theme folder.