Shortcodes and blocks
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.
| Shortcode | What it shows | Page 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.
| Attribute | What it does | Values |
|---|---|---|
category | Show only these categories. | Category slugs, separated by commas. |
category_exclude | Hide these categories. | Category slugs, separated by commas. |
category_menu | Show the subcategories of this category, and their items. | A parent category slug. |
cat_orderby | How to sort the categories. | include (default: the order you listed them in category), name, slug or id. |
cat_order | Category sort direction. | ASC (default) or DESC. |
fooditem_orderby | How to sort the items inside each category. | title (default), date, ID or menu_order. |
fooditem_order | Item 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#
| Shortcode | What 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.
| Block | What it shows | Options |
|---|---|---|
| Menu | The 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 & Checkout | The full checkout, or a cart on its own. | Mode: checkout or cart. |
| Order History | A logged-in customer's past orders, with one-click reorder. | Show past orders or previously ordered items. |
| Order Receipt | The order confirmation. Use it on your Success Page. | Turn items, prices, discounts, date, notes, payment method and order number on or off. |
| Food Search | A search box for the menu, like [foodsearch]. | None. |
| Opening Hours | Your 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.
