Menu Shortcodes

With the help of the menu shortcode, you can show the menu (from Appearance > Menus) and show it with a shortcode.

Before creating the shortcode make sure you have at least one menu into the Appearance > Menus.

Below is the screenshot of my Menus screen:

Here,

You can see there is one menu with the menu name One.

Now, I wan’t to show this menu with the help of the Menu shortcode from ShortcodeHub.

How to create the menu shortcode? How to create the menu shortcode?

  • Go to Shortcodes > Add new
  • You’ll see the Core Shortcodes > Menu
  • Then click on Create link

You’ll see something like below screenshot:

Then,

  • Add the Shortcode Title
  • Select the menu from the dropdown,
  • And press the publish button

Here,

  • I have selected the first One menu from the dropdown
  • And publish the shortcode

Finally,

You’ll see the shortcode created into the sidebar something like: [shortcodehub id=’THE_ID’]

E.g.

In above screenshot you’ll the shortcode is generated as: [shortcodehub id=’6021′]

Just copy the shortcode and use it anywhere.

Simple! right.

Top ↑

How to use the menu shortcode? How to use the menu shortcode?

You can use the shortcode anywhere including page, post, products, widgets, etc.

For this demo, I’m using the shortcode on the page.

So, I’m doing:

  • Create new page with title Test Page
  • Paste the copied shortcode [shortcodehub id=’6021′] into the page content
  • Click on Publish button to publish the page.

Screenshot:

Now, When I visit to the page then, I can see:

  • Page title as Test Page
  • And the shortcode content

Screenshot:

Scroll to Top