Linux 软件免费装
Banner图

WXP Opening Times

开发者 wvdploeg
更新时间 2026年10月25日 21:12
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

opening hours business hours holidays opening times open now

下载

1.0.0

详情介绍:

WXP Opening Times shows your opening times on any page with a shortcode, together with an Open/Closed badge that stays correct while the visitor is on the page. Shortcode [wxp_opening_times] Attributes: Elementor With Elementor active, the "Opening times" widget (panel "WXP Plugins") shows the same output as the shortcode. It has the same options, optional alternative texts for that widget, and style controls for the badge colours, the typography, the lines, the highlight of today and the week buttons. Block editor The "Opening times" block (category "WXP Plugins") has the same options as the shortcode in the sidebar, including the alternative texts, and shows a live preview in the editor. Like the shortcode and the Elementor widget it is rendered on the server, so the status is always current. Structured data (JSON-LD) Add schema="yes" to the shortcode (or switch on "Structured data for search engines" in the block or the Elementor widget) and the page also gets the opening times as schema.org JSON-LD (openingHoursSpecification), so search engines can show them. The weekly hours are included, and so are the exceptions of the next 365 days: a closed day has opens and closes "00:00". It is printed once per schedule on a page, and not in the editor previews. The business is a LocalBusiness with the site name and address of the home page; change the type or add details (address, phone number) with the wxp_opening_times_schema filter, for example to make it a Restaurant. If an SEO plugin already prints the data of your business, use wxp_opening_times_get_schema() to get the same array, and add it there. For developers Template override: copy a file from the plugin's templates folder to wxp-opening-times/ in your (child) theme. The markup contract is described at the top of _base.html.twig. Helper functions (call them after the init action): Filters: wxp_opening_times_status, wxp_opening_times_template_context, wxp_opening_times_template_paths, wxp_opening_times_twig_cache, wxp_opening_times_schema, wxp_opening_times_schema_days, wxp_opening_times_load_css (return false to load your own CSS) and wxp_opening_times_holidays (add holiday providers, for example for other calendars). CSS custom properties on .wxp-opening-times (--wxp-ot-open-bg, --wxp-ot-closed-bg and more) change the colours.

安装:

  1. Upload the plugin to /wp-content/plugins/ and activate it.
  2. Open "Opening times" in the admin menu and set your times.
  3. Add [wxp_opening_times] to a page.
The time zone, the week start day and the time format are taken from Settings, General.

屏幕截图:

  • Exceptions: a period with different times (such as winter hours) and a holiday rule, with a live preview.

常见问题:

Why does "open now" use the site's time zone?

Opening times belong to a place, not to the visitor. Set the right time zone under Settings, General.

Does it work with a page cache?

Yes. The status is refreshed in the browser when the page was cached for more than five minutes, and at the moment the status changes.

Which holidays are included?

Secular and Christian holidays, with the Christian ones calculated from Easter. Islamic and Jewish holidays come with the add-on WXP Opening Times: Jewish and Islamic holidays.

更新日志:

1.0.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0