Shortcodes overview
The plugin’s main functionality is usually accessed through shortcodes. Below is a list of all the codes you can use.
1. Display if you’re now open/closed, or are about to open/close: [mbhi]
Example
[mbhi location="your location name" format="12" openmessage="your dynamic message" closedmessage="your dynamic message"]
Note
The location
option is mandatory. All other options are optional. Without options, this shortcode will use the settings as configured in the Incidactor options
tab of the plugin settings page.
Options
Attributes | Possible values | Description |
---|---|---|
location | Anything | The name of the location you want to display the opening hours for. This is the same name as set under the ‘Locations & hours’ tab. |
format | 12, 24 | Display times in 12-hour or 24-hour format. |
openmessage | Anything | The message to display when you’re currently open. |
closedmessage | Anything | The message to display when you’re currently closed. |
approximation | true, false | Display an alternate message when it’s near opening/closing time. |
openingsoonmessage | Anything | The message to display when almost opening. Use {x} to denote minutes. |
openingsoonmessagetime | Number | Time to start showing the message, in seconds before opening time. |
closingsoonmessage | Anything | The message to display when almost closing. Use {x} to denote minutes. |
closingsoonmessagetime | Number | Time to start showing the message, in seconds before closing time. |
show_specialdate_messages | True, false | Whether or not to show alternative messages on special dates. |
specialdate_message_open | Anything | The message to display when today is a special date and you’re currently open. |
specialdate_message_closed | Anything | The message to display when today is a special date and you’re currently closed. |
from | A date (example: December 3) | If you’re using a location for seasonal hours, you can use ‘from’ to set when to start displaying the indicator. |
to | A date (example: February 18) | If you’re using a location for seasonal hours, you can use ‘to’ to set when to stop displaying the indicator. |
2. Display your opening times: [mbhi_hours]
Example:
[mbhi_hours location="your location name" format="24" display="consolidated" output="table"]
Note
The location
option is mandatory. All other options are optional. Without options, this shortcode will use the settings as configured in the Table options
tab of the plugin settings page.
Options
Attributes | Possible values | Description |
---|---|---|
location | Anything | The name of the location you want to display the opening hours for. This is the same name as set under the ‘Locations & hours’ tab. |
format | 12, 24 | Display times in 12-hour or 24-hour format. |
display | consolidated, normal | Whether or not to consolidate days with the same opening hours into 1 line. This could render something like Monday - Friday — 9AM - 5PM |
output | table, inline | Display the opening hours in a table or inline. |
includevacations | true, false | Whether or not to include vacation days in the output. |
includeholidays | true, false | Whether or not to include holiday opening hours in the output. |
consolidationseparator | -, —, space, |, , | The symbol between the day names. This option is only relevant when display is set to consolidated . Example: Monday | Friday. The pipe character (“|”) is the separator. |
hourseparator | -, —, |, space, , | The symbol between hours. Example: 10AM — 10PM, where the emdash (“—”) is the separator. |
entryseparator | -, —, |, space, , | The symbol between opening hours. This option is only relevant when output is set to inline . Example: Monday 1AM – 2PM, Tuesday 1AM – 2PM. Where the comma is the separator. |
mhbr | true, false | Add a line break between hour slots on the same day. Only relevant when output is set to table . |
day_part | Anything with {day} or {day_short} | The left part of the table for normal days. Usually contains the day name. Use {day_short} for an abbreviated day. |
showonlytoday | true, false | Show only today’s opening times. |
dates_in_past | true, false | Whether or not to show holidays & special dates that are in the past. |
replace_with_specials | true, false | Overwrite the week’s normal opening hours with special dates if they are overlapping. |
included_specials_format | Anything | Choose the format display special dates. You can use dynamic codes {date} to display the entry’s date, and {name} to display the entry’s name (which you filled out in the settings). Example: {name} ({date}) |
3. Show only vacations: [mbhi_vacations]
Example
[mbhi_vacations location="your location name"]
Note
The shortcode takes the same attributes as [mbhi_hours].
4. Show only special dates: [mbhi_specials]
Example
[mbhi_specials location="your location name"]
Note
The shortcode takes the same attributes as [mbhi_hours].
5. Print SEO output: [mbhi_seo]
Example
[mbhi_seo location="your location name"]
6. Show content only when your business is open: [mbhi_ifopen]
Example
[mbhi_ifopen location="your location name"]Your text or HTML content goes here.[/mbhi_ifopen]
Note
The location
attribute is obligated.
7. Show content only when your business is closed: [mbhi_ifclosed]
Example
[mbhi_ifclosed location="your location name"]Your text or HTML content goes here.[/mbhi_ifclosed]
Note
The location
attribute is obligated.