Skip to content
Docs
Get RestroPress

Shortcodes and blocks

Updated 4 min read
On this page

RestroPress puts its menu, cart, checkout and account pages on your site with shortcodes and, since RestroPress 3.4, with blocks. When you install RestroPress it creates the pages you need with the right shortcodes already in place, so you only need this page if you're building your own pages or changing how the menu shows.

Shortcodes and blocks do the same job. Use blocks in the WordPress block editor if you want to see the result as you edit; use shortcodes in page builders, widgets and classic pages. Existing shortcodes keep working, and you can switch a page to blocks whenever you like.

The names haven't changed. The admin now says "Menu Items" instead of "Food Items", but shortcodes such as [fooditems] and [fooditem_checkout] keep their original names.

Shortcodes for the main pages#

These are the pages RestroPress creates on install. They're selected under RestroPress › Settings › General › Store Setup.

ShortcodeWhat it showsPage created on install
[fooditems]The menu customers order from, with categories, search and the cart.Order Online
[fooditem_checkout]The checkout: contact details, delivery or pickup, payment and order summary.Checkout
[rpress_receipt]The order confirmation, with live order tracking.Order Confirmation
[order_history]A logged-in customer's past orders, with reorder.Orders
[rpress_login]A login form.Login
[rpress_register]A registration form for new customers.Register
[custom_forgot_password]A password reset form.Forgot Password

The menu: [fooditems]#

On its own, [fooditems] shows every published menu item, grouped by category. Its attributes let you show only some categories and change the order.

AttributeWhat it doesValues
categoryShow only these categories.Category slugs, separated by commas.
category_excludeHide these categories.Category slugs, separated by commas.
category_menuShow the subcategories of this category, and their items.A parent category slug.
cat_orderbyHow to sort the categories.include (default: the order you listed them in category), name, slug or id.
cat_orderCategory sort direction.ASC (default) or DESC.
fooditem_orderbyHow to sort the items inside each category.title (default), date, ID or menu_order.
fooditem_orderItem sort direction.ASC (default) or DESC.

A category's slug is shown under Menu Items › Categories.

Examples#

Show three categories, in this order:

[fooditems category="starters,pizzas,desserts"]

Show everything except drinks:

[fooditems category_exclude="drinks"]

Show only the subcategories of Lunch, such as Soups and Salads:

[fooditems category_menu="lunch"]

Sort categories A–Z and show the newest items first:

[fooditems cat_orderby="name" fooditem_orderby="date" fooditem_order="DESC"]

Replace the shortcode on your menu page; don't add a second copy alongside it.

Menu layout (list or grid), colours, buttons and the template pack are set under Settings › Styles, not in the shortcode.

Other shortcodes#

ShortcodeWhat it shows
[foodsearch]A search box that filters the menu as customers type. The menu page already has one; use this to place it somewhere else.
[fooditem_cart]The cart contents, for a separate cart page or a sidebar.
[rpress_cart]The menu page's cart panel, on its own.
[rpress_profile_editor]Lets logged-in customers change their name, email addresses, billing address and password.
[fooditem_history]The menu items a logged-in customer has ordered before.
[fooditem_discounts]A list of your active discount codes and their amounts.
[customer_dashboard]A customer account page with profile details and recent orders.

[rpress_login] and [rpress_register] accept a redirect attribute to send the customer to a specific page afterwards:

[rpress_login redirect="https://example.com/order-online/"]

Without it, [rpress_login] uses the Login Redirect Page setting, then the Order History page, then your home page.

Blocks#

RestroPress 3.4 adds six blocks. In the block editor, click + and look under the RestroPress category, or search for the block's name. Each block shows a live preview as you edit, and its options are in the block sidebar on the right.

BlockWhat it showsOptions
MenuThe menu with ordering, like [fooditems].Categories to include or exclude, layout, item sort order, and whether to show the category list, the delivery/pickup bar, search and the cart. Colours, typography, spacing and borders can be set from the Styles panel.
Cart & CheckoutThe full checkout, or a cart on its own.Mode: checkout or cart.
Order HistoryA logged-in customer's past orders, with one-click reorder.Show past orders or previously ordered items.
Order ReceiptThe order confirmation. Use it on your Success Page.Turn items, prices, discounts, date, notes, payment method and order number on or off.
Food SearchA search box for the menu, like [foodsearch].None.
Opening HoursYour weekly hours from Settings › General › Service & Hours. Good for footers and contact pages.Highlight today, show closed days, show holidays.

If you switch your menu, checkout, receipt or order history page from a shortcode to a block, keep the same page selected under Settings › General › Store Setup.

Was this page helpful?