WXP Restaurant Menu has two shortcodes: [wxp_menu] shows the full menu, and [wxp_menu_selection] shows a few dishes on another page, for example your favourites on the homepage. Both are also available as a block and as an Elementor widget, with the same settings.
[wxp_menu] #
The menu, grouped by category and sorted by sort order. Dishes that are not available today are hidden.
[wxp_menu]
[wxp_menu category="starters,main-dishes" show_images="no"]
[wxp_menu group="vegetarian" template="compact"]
[wxp_menu filters="categories,groups,tags"]
[wxp_menu tabs="yes" filters="groups" label_groups="Diet"]
Parameters #
| Parameter | Values | Default | What it does |
|---|---|---|---|
category |
category slugs, comma separated | all | Only these categories. The order you give is the order of the sections. Sub categories are included. |
group |
group slugs, comma separated | all | Only dishes in any of these dietary groups. |
tag |
tag slugs, comma separated | all | Only dishes with any of these tags. |
template |
default, compact, cards, elegant, side-by-side, or a template in your theme |
default |
The layout of the menu. |
show_images |
yes or no |
yes |
Show the photo of each dish. |
show_descriptions |
yes or no |
yes |
Show the description of each dish. |
show_groups |
yes or no |
yes |
Show the dietary groups (for example vegetarian) as labels. |
show_tags |
yes or no |
no |
Show the tags as labels. |
show_category_titles |
yes or no |
yes |
Show the category headings. |
heading_level |
2 to 6 |
2 |
The heading level of the top level categories. |
image_size |
a registered image size, for example thumbnail |
the size of the template | The image size to use. The cards template uses medium_large. |
filters |
categories, groups, tags, comma separated |
none | Filter buttons for visitors. Only categories, groups and tags of the shown dishes get a button. |
label_categories |
text | the site-wide text, or “Category” | The text in front of the category buttons. |
label_groups |
text | the site-wide text, or “Dietary” | The text in front of the group buttons. |
label_tags |
text | the site-wide text, or “Tags” | The text in front of the tag buttons. |
term_colors |
yes or no |
yes |
Use the pill colours of categories, groups and tags. |
icons |
yes or no |
yes |
Show the icons of categories, groups and tags. |
tabs |
yes or no |
no |
One tab per top level category, the first one open. Needs at least two top level categories and replaces the category filter. |
An empty label_* keeps the default text. The site-wide texts are set under Restaurant menu → Settings → Filter button labels.
[wxp_menu_selection] #
A few dishes on another page.
[wxp_menu_selection set="favourites" count="3"]
[wxp_menu_selection ids="12,15,18" mode="carousel" count="3" interval="5" menu_page="42"]
[wxp_menu_selection set="lunch" template="text" menu_page="/menu/"]
Parameters #
| Parameter | Values | Default | What it does |
|---|---|---|---|
ids |
menu item IDs, comma separated | none | The dishes to show, by ID. |
set |
set slugs, comma separated | none | The dishes in these sets are added to the IDs. Sets are made under Restaurant menu → Sets. |
mode |
random, carousel, list |
random |
random picks count dishes at random, new on every page view. carousel moves through up to 10 dishes, count visible at once. list shows the first count dishes in menu order. |
count |
1 to 10 |
3 |
The number of dishes shown, or visible at once in the carousel. |
interval |
2 to 30 |
4 |
Seconds between two moves of the carousel. |
template |
default, cards, text, or a template in your theme |
default |
The layout of the dishes. A theme template is a file named selection-{name}.html.twig. |
show_images |
yes or no |
yes |
Show the photos. The text template does not use this. |
show_descriptions |
yes or no |
yes |
Show the descriptions. The text template does not use this. |
show_prices |
yes or no |
yes |
Show the prices. |
image_size |
a registered image size | the size of the template | The image size to use. |
heading_level |
2 to 6 |
3 |
The heading level of the dish titles. |
menu_page |
a page ID or a URL | none | The page with the full menu. A dish then links to its category on that page. Without it the dishes are not links. |
Good to know #
- Yes and no: wherever a parameter takes
yesorno, you may also writetrue,1oronfor yes. Anything else counts as no. - Dishes that are not available today are left out of both shortcodes.
- Page cache: the dishes are part of the page, so they show at once. A cache can freeze the random choice; the plugin’s script then picks other dishes from the pool in the page when the page is older than a minute.
- Showing the code in a page: WordPress runs shortcodes everywhere in the content, also inside code blocks. To show a shortcode as text, write it with double brackets, like in this guide.