NAP Display
2. Displaying Name, Address, Phone (NAP)
You can easily display the core Name, Address, and Phone (NAP) information for any of your locations using a dedicated shortcode. This is great for contact pages, footers, or sidebars.
Pro Tip:
Use this shortcode in your footer or contact page to ensure consistent NAP information across your site while only needing to update it in one place.
Shortcode: [lbsg_location_nap]
This shortcode outputs the Name, Address, and Phone number for a specified location.
Attributes:
Attribute | Description | Default | Example |
---|---|---|---|
id Required |
The Post ID of the 'Location' CPT entry for which to display NAP information. | N/A | [lbsg_location_nap id="123"] |
show |
Comma-separated list of parts to display: 'name', 'address', 'phone'. | "name,address,phone" | [lbsg_location_nap id="123" show="name,phone"] |
name_field |
Determines which name to display. Use 'schema_name' for the "Schema Business Name" field, or 'title' for the Location post's title. | "schema_name" | [lbsg_location_nap id="123" name_field="title"] |
link_phone |
Set to 'true' or 'false'. Whether to wrap the phone number in a clickable tel: link. |
"true" | [lbsg_location_nap id="123" link_phone="false"] |
How to Use:
Insert the shortcode into any page, post, or text widget. Ensure you replace YOUR_LOCATION_ID
with the actual Post ID.
Example:
[lbsg_location_nap id="42"]
Styling:
The output uses the following CSS classes for styling:
.lbsg-nap-widget
Container.lbsg-nap-name
Business name.lbsg-nap-address
Address block.lbsg-nap-phone
Phone number
You can override these styles via your theme's CSS or by editing the plugin's frontend.css
file.
3. Displaying Opening Hours
Display your location's opening hours in a user-friendly, grouped format (e.g., "Monday - Friday: 9:00 AM - 5:00 PM").
Shortcode: [lbsg_location_hours]
This shortcode outputs the formatted opening hours for a specified location.
Attributes:
Attribute | Description | Default | Example |
---|---|---|---|
id Required |
The Post ID of the 'Location' CPT entry. | N/A | [lbsg_location_hours id="123"] |
title |
An optional heading to display above the hours list. | "Opening Hours" | [lbsg_location_hours id="123" title="Our Shop Hours"] |
show_closed |
Set to 'true' or 'false'. Whether to display days that are marked as closed. | "true" | [lbsg_location_hours id="123" show_closed="false"] |
time_format |
A PHP date format string for displaying times. | "g:i A" | [lbsg_location_hours id="123" time_format="H:i"] |
How to Use:
Insert the shortcode where you want the opening hours to appear.
Example: Displaying hours for location ID 42 with a custom title and 24-hour format:
[lbsg_location_hours id="42" title="Our Store Hours" time_format="H:i"]
Styling:
The output uses the following CSS classes for styling:
.lbsg-hours-widget
Container.lbsg-hours-list
List wrapper.lbsg-hours-item
Each day group.lbsg-hours-day
Day names.lbsg-hours-time
Time ranges
Troubleshooting Tip:
If opening hours are not displaying as expected, ensure you have correctly entered the days and times using the repeater field in the "Location Details" for that specific location post.