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

AttributesPossible valuesDescription
locationAnythingThe name of the location you want to display the opening hours for. This is the same name as set under the ‘Locations & hours’ tab.
format12, 24Display times in 12-hour or 24-hour format.
openmessageAnythingThe message to display when you’re currently open.
closedmessageAnythingThe message to display when you’re currently closed.
approximationtrue, falseDisplay an alternate message when it’s near opening/closing time.
openingsoonmessageAnythingThe message to display when almost opening. Use {x} to denote minutes.
openingsoonmessagetimeNumberTime to start showing the message, in seconds before opening time.
closingsoonmessageAnythingThe message to display when almost closing. Use {x} to denote minutes.
closingsoonmessagetimeNumberTime to start showing the message, in seconds before closing time.
show_specialdate_messagesTrue, falseWhether or not to show alternative messages on special dates.
specialdate_message_openAnythingThe message to display when today is a special date and you’re currently open.
specialdate_message_closedAnythingThe message to display when today is a special date and you’re currently closed.
fromA 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.
toA 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

AttributesPossible valuesDescription
locationAnythingThe name of the location you want to display the opening hours for. This is the same name as set under the ‘Locations & hours’ tab.
format12, 24Display times in 12-hour or 24-hour format.
displayconsolidated, normalWhether or not to consolidate days with the same opening hours into 1 line. This could render something like Monday - Friday — 9AM - 5PM
outputtable, inlineDisplay the opening hours in a table or inline.
includevacationstrue, falseWhether or not to include vacation days in the output.
includeholidaystrue, falseWhether 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.
mhbrtrue, falseAdd a line break between hour slots on the same day. Only relevant when output is set to table.
day_partAnything 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.
showonlytodaytrue, falseShow only today’s opening times.
dates_in_pasttrue, falseWhether or not to show holidays & special dates that are in the past.
replace_with_specialstrue, falseOverwrite the week’s normal opening hours with special dates if they are overlapping.
included_specials_formatAnythingChoose 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.

Was this article helpful?

Related Articles