Skip to content
WXP Plugins

Plugins

WXP Restaurant Menu

WXP Opening Times

WXP Local Events

WXP Restaurant Reservations

Demo

Pricing

Support

Docs

FAQ

Buy

Menu

Plugins

- WXP Restaurant Menu

- WXP Opening Times

- WXP Local Events

- WXP Restaurant Reservations

Demo

Pricing

Support

- Docs

- FAQ

Buy

WXP Opening Times

8
  • Installation
    • Installing WXP Opening Times
  • Basic operations
    • Creating your (first) schedule
    • Setting exceptions
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Opening Times shortcodes
  • Jewish and Islamic holidays
    • Installation
      • Installing WXP Opening Times: Jewish and Islamic holidays
    • For developers
      • Jewish and Islamic holidays: for developers

WXP Restaurant Menu

11
  • Installation
    • Installing WXP Restaurant Menu
  • Basic operations
    • Understanding the concept
    • The Settings for the WXP Restaurant Menu Plugin
    • The Icon menu
    • The Sets Menu
    • The Tags Menu
    • The Groups Menu
    • The Categories menu
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Restaurant Menu shortcodes

WXP Local Events

8
  • Installation
    • Installing WXP Local Events
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Local Events shortcodes
  • Local Events for WooCommerce
    • Installation
      • Installing WXP Local Events for WooCommerce
    • For developers
      • Local Events for WooCommerce: for developers
  • Events Feed
    • Installation
      • Installing WXP Events Feed
    • For developers
      • Events Feed: for developers

WXP Restaurant Reservations

6
  • Installation
    • Installing WXP Restaurant Reservations
  • For developers
    • Filter- and action hooks
    • Twig templates
    • WXP Restaurant Reservations shortcodes
  • Rooms
    • Installation
      • Installing WXP Restaurant Bookings: Rooms
    • For developers
      • Rooms: for developers

General Developer Information

1
  • Twig
    • Twig templates in the WXP plugins

WXP Agency Kit

1
  • WXP Agency Kit: demo content from the command line
View Categories
  • Home
  • Documentation
  • WXP Opening Times
  • For developers
  • Twig templates

Twig templates

1 min read

0:00 / 2:42
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

The layouts of WXP Opening Times are Twig templates. This guide lists the templates, the values they receive and how to make your own. For an introduction to Twig and the lookup order, see General Developer Information → Twig.

Templates #

File Name What it shows
default.html.twig Default The status line and a table with the hours of the week.
compact.html.twig Compact One line: the status and the hours of today. No week table.
grouped.html.twig Grouped days Like the default, but days that follow each other and have the same hours share a line, such as “Monday to Thursday”.
_base.html.twig Partial The wrapper that all templates extend. It holds the data attributes that the script and the stylesheet need.
_status.html.twig Partial The open or closed badge and the summary.
_nav.html.twig Partial The buttons to browse to the next and the previous week.

Use the name of the file without .html.twig in the template parameter of the shortcode, the block or the widget. A name that does not exist falls back to default.

Your own template #

{# Template Name: My hours #}
{% extends '_base.html.twig' %}

{% block body %}
	{% if options.show_status %}
		{% include '_status.html.twig' %}
	{% endif %}
	<ul>
	{% for day in week.days %}
		<li{% if day.today %} class="is-today"{% endif %}>
			{{ day.name }}: {{ day.open ? day.text : closed }}
		</li>
	{% endfor %}
	</ul>
{% endblock %}
  • Save it as my-hours.html.twig in wxp-opening-times/ in your child theme and use template="my-hours".
  • The line Template Name: in the comment is the name shown in the template lists of the block and the widget.
  • Keep the content in {% block body %}. When a visitor browses to another week or the status changes, only this block is rendered again and replaced.
  • Keep {% extends '_base.html.twig' %}: it carries the attributes that the script uses.

Values in the templates #

Name Contents
status open (true or false), badge, summary, closes_at, opens_at, next_change.
today The day of today, with the same fields as a day in week.days.
week offset, label (for example “3 Nov – 9 Nov”), days (seven days) and groups (days with the same hours, for the grouped template).
week.days[] date, name, date_label, today, open, slots (each with open, close and text), text (all slots as one text), exception, source and label.
week.groups[] name (such as “Monday to Thursday”), date_label, days (how many), today, open, slots, exception and label.
schedule id and name.
closed The text for a closed day.
options show_status, week_nav, show_title, show_dates, weeks_ahead, heading_level and offset.
labels Translated texts.
template, box_id, generated The name of the template, a unique id for this block on the page, and the time of rendering.

Add your own values with the filter wxp_opening_times_template_context (see Filter- and action hooks).

Updated on October 30, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Filter- and action hooksWXP Opening Times shortcodes
Table of Contents
  • Templates
  • Your own template
  • Values in the templates
WXP Plugins

Demo

Pricing

© 2026 WXP Plugins. All prices are in euro, excluding VAT.

WXPPlugins is a brand of WP Digital Marketing - The Netherlands - Chamber of Commerce (KvK) 75580152