Mai Menu [mai_menu] Shortcode

Add any menu to a shortcode block anywhere on your site.

Our Mai Menu shortcode is basically a holdover until WordPress includes the Navigation Menu block in core. Right the Navigation Menu block is functional and stable in the Gutenberg plugin, but we need menus in blocks now so we’ve created the shortcode. Use in the Shortcode block.

The default shortcode displays a horizontal menu with menu items aligned left.

Here is an overview of how to use shortcodes.

There are a few parameters to customize your menu.

id (required)

The id parameter accepts a menu slug, name, or ID number.

Examples:

[mai_menu id="utility-menu"]
[mai_menu id="Utility Menu"]
[mai_menu id="123"]

align

The align parameter accepts left(this is the default),center, orright.

Example:

[mai_menu id="utility-menu" align="right"]

display

The display parameter accepts list. This changes the menu from horizontal to a standard vertical list of menu item links.

Example:

[mai_menu id="utility-menu" display="list"]

class

Add a custom class to the menu.

Example:

[mai_menu id="utility-menu"]

font_size

The font_size parameter accepts xs, sm, md, lg, xl, xxl, xxxl, xxxxl, or any CSS unit value like 16px, 1em, 1.2rem. Any number value like 16 will automatically be used as a pixel value.

Examples:

[mai_menu id="utility-menu" font_size="sm"]
[mai_menu id="utility-menu" font_size="16px"]
[mai_menu id="utility-menu" font_size="1em"]
[mai_menu id="utility-menu" font_size="15"]

label

Add a label for accessibility, screen readers, and assistive devices.

Examples:

[mai_menu id="utility-menu" label="Secondary"]
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us