Skip to main content

How to add the cart, login and register links to your WordPress menu

The WithWine plugin adds Login, Register and Cart links to classic WordPress menus automatically. You can choose where they appear in Settings > WithWine, or add a cart button anywhere with the menu-cart-link shortcode.

Automatic menu links

If your WordPress theme uses the classic menu builder, the WithWine plugin adds Login, Register and Cart links to your main menu automatically.

Choose where the links appear

  1. In WordPress admin, go to Settings > WithWine.

  2. In Login / Logout Link Container ID, Register Link Container ID and Cart Link Container ID, enter the HTML ID of the place where each link should go. You can also enter a CSS class selector, for example .ww-cart-goes-here.

  3. To hide a link, enter an ID that doesn't exist on your website, for example ww_do_not_render_this.

  4. Click Save Changes.

For example, in Elementor you can give an empty container the class ww-cart-goes-here and enter .ww-cart-goes-here as the cart location.

Add a cart button anywhere

[withwine type='menu-cart-link' /]

  • data_badge sets where the number of items shows: after (default), before or none.

  • data_content sets the button content, for example text or an image.

Show links only to logged-in or logged-out customers

[withwine type='conditional-content' data_showif='loggedout' data_action='login' data_text='Log in' /]
[withwine type='conditional-content' data_showif='loggedin' data_action='logout' data_text='Log out' /]

data_action can be login, logout or a web address.

Things to know

  • The cart is available on every page. It opens when a customer clicks Show Cart on a product or the cart link. The cart shows each product, the quantity, shipping and the Empty Cart, Continue Shopping and Checkout buttons.

  • Change the empty cart message, subtitle, button text and image in Settings > WithWine, under Cart Settings.

  • If you use the newer WordPress block editor menus (Gutenberg), add the links yourself with the shortcodes above.

Related articles

Did this answer your question?