Skip to content
Docs
Get RestroPress

Shortcodes and blocks

Updated 6 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.

Renamed in 3.5.1#

Four shortcodes had generic names that other plugins also use, and WordPress keeps only the last plugin to register a name. They now start with rpress_.

New nameOld name
[rpress_order_history][order_history]
[rpress_customer_dashboard][customer_dashboard]
[rpress_forgot_password][custom_forgot_password]
[rpress_food_search][foodsearch]
  • The old names keep working as aliases, as long as no other plugin has registered the same name.
  • Your pages are updated for you, once. After you update, RestroPress rewrites the old names to the new ones in your content. If another plugin owns an old name, RestroPress only changes the pages it set up itself (Order History and Forgot Password), so the other plugin's pages are left alone.
  • Check page builders and widgets. The automatic update changes post and page content. A shortcode stored somewhere else, such as a widget or a page builder's own data, is not rewritten; it keeps working through the old name, but update it when you can.
  • If a new name shows as plain text on your page, your copy of the plugin does not have the new names yet. Update RestroPress, or use the old name until you do.

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
[rpress_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
[rpress_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
[rpress_food_search]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.
[rpress_reservation]The table booking form (3.5). Takes a title attribute (default "Reserve a table"); title="" hides the heading. See Table reservations.
[rpress_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 added six blocks and 3.5 adds six more: the Table Reservation block and five blocks for building a whole ordering page (see Block storefront). 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 [rpress_food_search].None.
Opening HoursYour weekly hours from Settings › General › Service & Hours. Good for footers and contact pages.Highlight today, show closed days, show holidays.
Table Reservation (rpress/reservation-form)The table booking form, like [rpress_reservation].Title (default "Reserve a table"). Supports wide and full alignment, margin and padding.
Service BarThe delivery or pickup choice with the order date and time, the same bar the classic menu uses.None.
Menu CategoriesLinks to the menu's category sections, as a sticky bar that highlights the section in view.Show only or exclude categories, orientation (horizontal bar or vertical list), sticky while scrolling, filter instead of scroll.
Menu SearchA search box that filters the menu items on the page as you type.Placeholder.
Menu ItemsYour menu items grouped by category, as a grid or a list.Show only or exclude categories, layout, columns (1 to 4), order and direction, and image, description and price switches.
Cart PanelA mini cart with options, quantities, totals and a checkout button.Title (empty means "Your Order"), sticky while scrolling on desktop.

The five storefront blocks need WordPress 6.5 or later. 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?