Opening Hours is a highly customizable WordPress plugin to set up your venue's opening hours and display them with Shortcodes and Widgets.
- Features
- Installation
- Getting Started
- Widgets
- Shortcodes
- Troubleshooting / FAQ
- Contributing
- Changelog
- Credits
- License
- Supports multiple Sets of Opening Hours (e.g. one for your restaurant and one for your bar) that you can use independently.
- Supports Hollidays
- Supports Irregular Openings (e.g. different opening hours during Christmas)
- Supports child sets that overwrite your regular opening hours in a specific time period (e.g. seasonal opening hours or an extra day in every second week)
- Four highly customizable Widgets and Shortcodes also displaying contextual information (e.g. "We're currently closed but will be open again on Monday at 8am")
- Go to your WordPress dashboard
- Navigate to "Plugins"
- Click "Install"
- Search for "Opening Hours"
- Click "Install" on the Plugin "Opening Hours" by Jannik Portz
- Activate the Plugin
- Download the .zip-archive from https://wordpress.org/plugins/oh-opening-hours/
- Unzip the archive
- Upload the directory /opening-hours to your wp-content/plugins
- In your Admin Panel go to Plugins and active the Opening Hours Plugin
- Now you can edit your Opening Hours in the Settings-Section
- Place the Widgets in your Sidebars or use the Shortcode in your posts and Pages
If you are managing your WordPress Plugins via composer (e.g. when using Bedrock) the Opening Hours Plugin is also available on wpackagist.
Make sure you have wpackagist registered as repository in your composer.json file
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
Add the Opening Hours plugin as dependency
"require": {
"wpackagist-plugin/oh-opening-hours": "1.2"
}
Especially when installing a beta version for testing it makes sense to clone the GitHub Repository and checkout the branch from which you want to install the plugin. Before you can actually use the plugin you will have to perform the following steps (Node.js required)
- Open your command line and navigate to the project directory
- Make sure you have already loaded the submodules. If not run
git submodule update
- If you do not already have gulp installed globally run
npm install -g gulp
npm install
gulp build
Alternatively you can also clone the repository somewhere on your computer and run gulp export
instead of gulp build
.
A .zip archive containing a built version of the plugin will be placed inside the project directory that you can unzip and place in
the wp-content/plugins
directory of the WordPress installation of your choice.
The first step to set up your Opening Hours is to create a Set. A Set consists of Periods for all weekdays, Holidays and Irregular Openings. If you only want to display the Opening Hours for one venue you're fine with a single Set but you can as well add multiple Sets, each representing individual Opening Hours. You can for example add one Set for your restaurant and one Set for your Bar if you use one website for them and specify the desired Set per Widget or Shortcode.
Please Note: You will need to have administrator priviledges to manage Sets
Step 1: Go to your admin Dashboard and navigate to "Opening Hours". You will see a list of all your Sets. To add a new Set click "Add New" next to the heading.
Step 2: Give your Set a name in the "Enter title here" input. The name is only used internally and you can specify individual titles per Widget or Shortcode.
Step 3: Set up Opening Hours. In the Opening Hours Section you can edit the time inputs for each weekday. When clicking the +
-Button you can add more periods per day. When clicking the x
-Button next to a period you can delete periods.
Step 4: Set up Holidays. In the Holidays Section you can edit the name and the start and end dates. When clicking the "Add New Holiday" you can add more Holidays. You can also delete holidays when clicking the x
-Button next to a Holiday.
Step 5: Set up Irregular Openings. Irregular Openings specify irregular opening hours for a specific day. You would for example add an Irregular Opening for NYE when you are only open in the morning. You can edit the name, the date and start and end time.
When clicking the "Add New Irregular Opening" you can add more Irregular Openings. You can also delete Irregular Openings when clicking the x
-Button next to a row.
Step 6 (optional): In the Set Details Section you can give your Set a description. This is optional but the description can be displayed in the Overview Widget/Shortcode.
Step 7 (optional): In the Set Details section you can also set your custom Set Alias which you can use instead of the Set Id in Shortcodes. If you specify a specific Set Alias for more than one Set all Shortcodes will use the Set with the least value for menu_order
.
Your Theme or a 3rd party Plugin may also specify Set Alias presets to make it easier for yor to enter the right one. Please note that Set Alias presets only work in browsers supporting HTML5 datalist
.
Step 8: Save the data by clicking the "Save"/"Publish"-Button. Any changes will not be saved without saving the whole Set!
You may also set up child Sets with different Opening Hours for a longer Period of time. You can define a date range or a week scheme (even/odd weeks) when the Opening Hours of the Child Set should be used. You can for example use Child Sets if you have different Opening Hours in winter.
In Child Sets you can only set up Opening Hours but no Holidays or Irregular Openings.
Step 1: Make sure you have another Set which you can use as parent Set with the "regular" Opening Hours.
Step 2: Add a new Set by clicking the "Add New"-Button in the list of Sets.
Step 3: In the Attributes Section select the parent Set under "Parent".
Step 4: Click the "Save"/"Publish"-Button
Step 5: Set up the custom Opening Hours for the Child Set.
Step 6: Set the usage criteria in the Set Details Section. You can set a start and end date and/or a week scheme. Note that if you don't set start or end date and leave week scheme at "Every Week" the Child Set will never be used.
Step 7: Save the Child Set.
The Plugin will now automatically use the Opening Hours of the Child Set when the usage criteria matches the current time.
The Overview widget displays a table with all the opening hours in the speficied set.
There are the following options:
Title | The title of the Widget. Will be displayed above the opening hours
| Set to show | Select the set whose opening hours you want to show
| Highlight |
Select which type of information shall be highlighted. Possible options are:
| Show closed days | Whether to display a row for closed days with a "Closed"-caption
| Show description | Whether to display the set description above the opening hours
| Compress opening hours | Whether to compress the opening hours. This means that the plugin will search for days with mutual opening hours and then group those together to one row in the table with a title like "Monday - Wednesday".
| Use short day captions | Whether to use abbreviations for weekdays. E.g. "Monday" becomes "Mon.". This feature is also available in all other supported languages.
| Include Irregular Openings | If there is an irregular opening on any day in the table it will replace the regular opening hours with the irregular opening hours for that day.
| Include Holidays | If there is a holiday during one or more days in the table it will replace the regular opening hours of those days with the name of the holiday.
| Template | You can choose among two templates: Table and List. The list template will display all data in a vertical list. This is useful for narrow sidebars.
Extended Settings
| Caption closed | Speficy a custom caption for closed days.
| Highlighted period class | Custom CSS class for highlighted periods. default highlighted
| Highlighted day class | Custom CSS class for highlighted days. default: highlighted
| PHP Time Format | Custom format for times. The default is your standard WordPress setting. More on PHP date and time formats
| Hide date of irregular openings | Whether to hide the date of irregular openings if they are in the table.
| Week offset | Number of weeks the shortcode data shall be offset. Might be a positive or negative integer.
The Is Open Widget displays a message whether a venue (a Set) is currently open/active. Name
Description
|