

Opening hours table on the front end, rendered by the Open Hour block. Marks for open and closed cells are customizable.
Show your business hours as a weekly opening hours table: time slots as rows, Monday to Sunday as columns, and a mark in every cell where you are open.
Add the table with a block, a widget or a shortcode, and output LocalBusiness structured data (JSON-LD) with openingHoursSpecification for search engines.
Formerly known as “Taro Open Hour“.
It fits the Japanese-style consultation hours table (診療時間表), e.g. “9:00–12:00 / 14:00–18:00” rows with ○ for open and × or / for closed.
Settings > Business Places.[open-hour] and [business-place], also usable in block themes.Case 1
If your site is for your bookstore, add your store’s location as a business place.
The location and opening hours are available via widgets.
Case 2
If your site is a database of bouldering gyms, choose a post type to be treated as a location.
Each single page will have its own place and opening hour information.
Blocks
In the block editor, you can use “Open Hour” and “Business Place” blocks.
Choose a place in the block settings. If empty, the current post or the site location is used.
Widgets
You can use widgets for opening hours and business locations.
Shortcodes
You can use the shortcode [open-hour] for the time table. If you are a theme developer,
just use the tsoh_the_timetable() function.
For business places, you can use [business-place post_id='10'].
The attribute post_id can be omitted and its default value is the current post.
Here is a list of customizations.
If you have tsoh-style.css in your theme folder, it will be used.
Child theme supported.
We also have filter hook tsoh_stylesheet. Below is the example to change css url.
<?php
// Change css path.
add_filter('tsoh_stylesheet', function($style){
$style = [
'url' => get_stylesheet_directory_uri() . '/assets/css/table.css',
'version' => wp_get_theme()->get('Version'),
];
return $style;
});
If you return false from the filter hook, no style will be loaded.
The table’s template is located at taro-open-hour/templates/time-table.php.
Copy it to your-theme/template-part/tsoh/time-table.php and change the markup.
Of course, you can change the template path with a filter hook.
// e.g. If post type is event, change template from default.
add_filter( 'tsoh_timetable_template_path', function( $path, $post ) {
if ( 'event' == $post->post_type ) {
$path = get_template_directory() . '/templates/yours/event.php';
}
return $path;
}, 10, 2 );