- Standard shortcode
- Table designs
- Opening hours as text
- Consolidation
- Conditional shortcodes
- The time now
- Replacement text and logic
- Replacement text reference
Standard shortcodes
Just the standard opening hours (placed in a shortcode block) without anything added.
[open]
Monday: | 09:00 – 18:00 |
---|---|
Tuesday: | 09:00 – 18:00 |
Wednesday: | 09:00 – 18:00 |
Thursday: | 09:00 – 18:00 |
Friday: | 09:00 – 18:00 |
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
The following shortcodes can be placed in a normal text block; rather than a shortcode block. Once placed in the editor, check in the browser HTML to ensure that you’re compliant with web standards.
[open list]
- Monday: 09:00 – 18:00
- Tuesday: 09:00 – 18:00
- Wednesday: 09:00 – 18:00
- Thursday: 09:00 – 18:00
- Friday: 09:00 – 18:00
- Saturday: 09:00 – 14:30
- Sunday: Closed
[open lines]
Monday: 09:00 – 18:00
Tuesday: 09:00 – 18:00
Wednesday: 09:00 – 18:00
Thursday: 09:00 – 18:00
Friday: 09:00 – 18:00
Saturday: 09:00 – 14:30
Sunday: Closed
[open sentence]Monday: 09:00 – 18:00; Tuesday: 09:00 – 18:00; Wednesday: 09:00 – 18:00; Thursday: 09:00 – 18:00; Friday: 09:00 – 18:00; Saturday: 09:00 – 14:30; Sunday: Closed.
Table designs
There are many designs available built into the plugin’s functionality.
[open class="hours-right outside-flush no-border"]
Monday: | 09:00 – 18:00 |
---|---|
Tuesday: | 09:00 – 18:00 |
Wednesday: | 09:00 – 18:00 |
Thursday: | 09:00 – 18:00 |
Friday: | 09:00 – 18:00 |
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
[open class="hours-right outside-flush no-border" consolidation="separate" time_format="12_dot_trim"]
Weekdays: | 9am – 6pm |
---|---|
Saturday: | 9am – 2.30pm |
Sunday: | Closed |
[open class="hours-right current-line past-fade" day_format="short_date_short_month" time_format="12_dot_trim" update=true]
Mon 25th Sep: | 9am – 6pm |
---|---|
Tue 26th Sep: | 9am – 6pm |
Wed 27th Sep: | 9am – 6pm |
Thu 28th Sep: | 9am – 6pm |
Fri 29th Sep: | 9am – 6pm |
Sat 30th Sep: | 9am – 2.30pm |
Sun 1st Oct: | Closed |
[open class="hours-right closed-italic past-fade" day_format="full_date_month" time_format="12_colon" update=true]
Monday 25th September: | 9:00am – 6:00pm |
---|---|
Tuesday 26th September: | 9:00am – 6:00pm |
Wednesday 27th September: | 9:00am – 6:00pm |
Thursday 28th September: | 9:00am – 6:00pm |
Friday 29th September: | 9:00am – 6:00pm |
Saturday 30th September: | 9:00am – 2:30pm |
Sunday 1st October: | Closed |
With special opening hours, you can list alternative hours over the holiday period.
[open class="hours-right closed-italic" day_format="full_date_month" time_format="12_dot_trim" start="2022/12/23" end="2022/12/28"]
Wednesday 21st December: | 9am – 6pm |
---|---|
Thursday 22nd December: | 9am – 6pm |
Friday 23rd December: | 9am – 6pm |
Saturday 24th December: | 9am – 2.30pm |
Sunday 25th December: | Closed |
Monday 26th December: | 9am – 6pm |
[open class="hours-right closed-bold" day_format="full_date_month_nos" regular=false start="2022/12/23" end="2023/01/03"]
Check out the HTML Classes section in the plugin’s settings located in the Shortcodes tab. Using the update parameter will refresh the design when the opening status and days change.
Opening hours as text
It is easy to add your opening hours as text in existing content or as a stand-alone section.
Our opening hours are: [open text time_format="12_dot_trim" closed="Oh no, we’re closed" day_separator="; | and "]
Our opening hours are: Monday: 9am – 6pm; Tuesday: 9am – 6pm; Wednesday: 9am – 6pm; Thursday: 9am – 6pm; Friday: 9am – 6pm; Saturday: 9am – 2.30pm and Sunday: Oh no, we’re closed.
Our opening hours are: [open text closed_show=false day_separator="; | and " consolidation="separate"]
Our opening hours are: Weekdays: 09:00 – 18:00 and Saturday: 09:00 – 14:30.
[open text tag="p" weekdays_text="" weekend_text="" everyday_text="" consolidation="weekdays"]
Monday – Friday: 09:00 – 18:00; Saturday: 09:00 – 14:30; Sunday: Closed.
All of these shortcodes can be placed in either the shortcode block or the standard text block. Be careful when only using the shortcode as you may need to add <div>
or similar as an enclosing element. Once placed, please check in the browser HTML to ensure that you’re compliant with web standards.
Consolidation
You may group days in the week and weekend separately, together or not at all.
[open consolidation="none"]
Monday: | 09:00 – 18:00 |
---|---|
Tuesday: | 09:00 – 18:00 |
Wednesday: | 09:00 – 18:00 |
Thursday: | 09:00 – 18:00 |
Friday: | 09:00 – 18:00 |
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
[open consolidation="separate"]
Weekdays: | 09:00 – 18:00 |
---|---|
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
[open consolidation="weekdays"]
Weekdays: | 09:00 – 18:00 |
---|---|
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
[open consolidation="weekdays" weekdays_text=""]
Monday – Friday: | 09:00 – 18:00 |
---|---|
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
[open consolidation="weekend"]
Monday: | 09:00 – 18:00 |
---|---|
Tuesday: | 09:00 – 18:00 |
Wednesday: | 09:00 – 18:00 |
Thursday: | 09:00 – 18:00 |
Friday: | 09:00 – 18:00 |
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
[open consolidation="all"]
Weekdays: | 09:00 – 18:00 |
---|---|
Saturday: | 09:00 – 14:30 |
Sunday: | Closed |
Note the weekend will only appear consolidated both days, here Saturday and Sunday, have exactly the same opening hours. Additionally, full consolidation using “all” will only occur when all days have identical opening hours.
Conditional shortcodes
You can enclose any text or HTML content within a shortcode to show or hide this depending on the current status of the business: open or closed.
[open_now]We’re open![/open_now] [closed_now]Sorry, we’re closed[/closed_now]
Sorry, we’re closed
By default the content of the shortcode will update itself when the change of status occurs. An enclosing tag of <div>
or <span>
is added depending on the content of the shortcode. It is always better to specify your preference.
[open_now tag="div" update=false]<img src="/wp-content/uploads/Were-Open-Motif.svg" alt="We’re Open!">[/open_now]
[closed_now tag="div" update=false]<img src="/wp-content/uploads/Were-Closed-Motif.svg" alt="We’re Closed">[/closed_now]
If you are using a caching service on your website, the content of the page may be out-dated. So, you can perform an immediate check using the current time and returning the correct information.
[open_now update="immediate"]We’re currently open, but just checking because this website uses a caching service… The time is: [open_text]%now%[/open_text].[/open_now]
[closed_now update="immediate"]We’re currently closed, but just checking because this website uses a caching service… The time is: [open_text]%now%[/open_text].[/closed_now]
You can reload the entire page on the change from open to closed (or vice-versa). Nothing will appear if the business is currently closed. Note in the working shortcode, the reload functionality is disabled so that other shortcode instances will run uninterrupted.
[open_now reload=true]We’re open now so please drop into our shop![/open_now]
By default, there is no HTML present when the status doesn’t match. You can choose to set the hidden content to remain present in the element’s data.
[open_now remove_html=false]We’re open! <em>(HTML visible in source code)</em>[/open_now] [closed_now remove_html=false]Sorry, we’re closed <em>(HTML visible in source code)</em>[/closed_now]
We’re open! (HTML visible in source code) Sorry, we’re closed (HTML visible in source code)
Each shortcode has the parameter: class="open-text"
for illustrative purposes only. As a reference, the opening hours are:
Monday – Friday: 09:00 – 18:00; Saturday: 09:00 – 14:30; Sunday: Closed.
and the time is: 06:05.
The time right now
What is the time right now?
<p class="open-text">[open_text]%now%[/open_text]</p>
06:05
As this is simply text, this shortcode and its content exists within a standard paragraph block rather than in a shortcode block.
If you are experiencing problems with out-dated versions of your page, please start with this shortcode to identify the issue with either your cache or the incorrect timezone.
This website is running on the timezone: Europe/London so it is either GMT (GMT+0) or BST (GMT+1).
Replacement text and logic
You can do a lot with replacement text and logic!
<p class="open-text">[open_text] %if_open_now% We are currently open, so pop in! %end% %if_open_later% We are currently not open, but we will be open today at: %today_next%. %end% %if_closed_now% %if_not_open_later% We are currently not open for the remainder of the day %if_open_tomorrow%, however we are open tomorrow at %tomorrow_start%. %else% and closed tomorrow. %end% %end% %end% [/open_text]</p>
We are currently not open, but we will be open today at: 09:00.
Additional spacing is added for readability. When processed, spaces before and after logic statements are removed.
Replacement text reference
There is plenty of text to play around with… here is a complete list of all the text replacement codes, their current values and a description.
Code | Value | Description |
---|---|---|
%now% | 06:05 | Formatted current time |
%hours_today% | 09:00 – 18:00 | Formatted list of hours for today |
%hours_tomorrow% | 09:00 – 18:00 | Formatted list of hours for tomorrow |
%today_start% | 09:00 | Formatted opening for today |
%today_end% | 18:00 | Formatted last closing time for today |
%today_next% | 09:00 | Formatted next opening or closing time today |
%today% | Tuesday | Today’s day name |
%tomorrow% | Wednesday | Tomorrow’s day name |
%tomorrow_start% | 09:00 | Formatted first opening time for tomorrow |
%tomorrow_end% | 18:00 | Formatted closing time for tomorrow |
%seconds% | 10466 | Seconds until either change in opening or closing status |
%seconds_padded% | 10466 | Seconds with 2-digit padding for remaining time for change in opening or closing status |
%seconds_divisor% | 26 | Seconds as a divisor until either change in opening or closing status — useful when displayed with minutes |
%seconds_divisor_padded% | 26 | Seconds as a divisor with 2-digit padding for remaining time for change in opening or closing status — useful when displayed with minutes |
%minutes% | 174 | Minutes until either change in opening or closing status |
%minutes_padded% | 174 | Minutes with 2-digit padding for remaining time for change in opening or closing status |
%minutes_divisor% | 54 | Minutes as a divisor until either change in opening or closing status — useful when displayed with hours |
%minutes_divisor_padded% | 54 | Minutes as a divisor with 2-digit padding for remaining time for change in opening or closing status — useful when displayed with hours |
%hours% | 2 | Hours until either change in opening or closing status |
%hours_padded% | 02 | Hours with 2-digit padding for remaining time for change in opening or closing status |
%days% | 0 | Days until either change in opening or closing status |
%space% | Space character | |
%comma% | , | Comma character |
%colon% | : | Colon character |
%semicolon% | ; | Semi-colon character |
%exclamation% | ! | Exclamation mark character |
%question% | ? | Question mark character |
%fullstop% | . | Fullstop/period character |
%percent% | % | Percent character |