Want an easy way to show business hours on your WordPress site? Learn how to display a message automatically when you are open, and show your opening hours when closed.
In a world where your online audience is international, displaying your business hours is essential. Customer satisfaction rates improve when users from overseas are aware of your timezone and opening hours.
With Formidable, it's easy to show business hours on your WordPress site. Use a form to enter your business hours, and display them with Views. This is the same method we use to display our support hours in the Formidable help desk.
** Shortcut ** Want this functionality without the effort? We have a pre-built business hours template you can use!
Build a form to enter your business hours
This tutorial covers the four basic steps to build this system. The form is very simple with one repeater section with three fields inside it. I'll include a dropdown field to choose the day, and time fields for the opening and closing times.
Opening hours may need to be updated in the future, so I'm allowing front-end editing of entries. I'm also limiting submissions to one per logged-in user. Since this form will only ever have a single entry, this makes updating the opening hours quick and easy.
Publish this form on a password-protected page or use it in an admin area of your site. Make sure to submit this form with details for every day that you are open.
Create a View to display your opening hours
This View is quick and straight forward to build. It should be set as a single entry view, with your "Business Hours" form as the data source.
This View uses of the foreach shortcode, which displays one line for each row in a repeater. To simplify the shortcodes below, we'll use keys for the 4 form fields. The repeater ID is "R". The choose a day field ID is "day". The opening time field ID is "open" and the closing time field ID is "close".
Your View content should look something like this:
[foreach R] [day]: [open format='g:i A'] - [close format='g:i A'] [/foreach]
Do not embed this View directly into a page. Instead insert it into "No Entries message" box for the second View. The filtering on this second View will display opening hours only when you are closed, and a custom message when you are open.
Create a View with "Open Now" and "Closed Now" messages
The second View should also be set as a single entry View. This time, add three View filters.
The three filters ensure that the main content of the View is only visible during opening hours. The View content can include any custom message you wish. For this example the message will show today's opening hours using this in the View content box:
We're Open Today: [open format='g:i A'] - [close format='g:i A']
I'd recommend customizing the "We're Open" and "We're Closed" messages to suit your unique audience.
Next, add the filters and a "No Entries message". Outside of opening hours, the "No Entries message" is shown, so insert the first View here to display a full list of your business hours for the week.
Show business hours on your WordPress site
Once complete, insert the shortcode for your second View at the top of your customer facing pages. It's as simple as that! Now when a page loads, the appropriate message is shown depending on the current time.
** Pro Tip ** Great communication is key to any successful business. Consider including your phone number and store address in the "We're Open" message. Also, you could add your email address and social media accounts to the "We're Closed" message, so it's always easy to get in touch.
While visitors are contacting you, why not add them to your mailing list? Read how to connect your Formidable contact forms with MailChimp to turbocharge your online presence!
If you're not yet a Pro user of the best WordPress forms, upgrade today and take advantage of the powerful features available. Check out the form maker license packages to see which package suits you best!