[menu]
The shortcode is designed to render a customizable navigation menu.
Product
Shortcode Attributes
- name – The name of the menu to display. If not provided, the theme location is used.
- Options: Any text value. Specify one only.
- theme_location – The theme location where the menu is registered.
- Default:
.main-nav - Options:
main-nav,location-menu,footer-links,footer-links-2,footer-links-3,footer-links-4,mobile-menu,top-menu. Specify one only.
- Default:
- type – The type of menu to render.
- Default:
accordion medium-dropdown. - Options:
accordion,medium-accordion,large-accordion dropdown,medium-dropdown,large-dropdown,drilldown,medium-drilldown,large-drilldown. Allows multiple values. Use spaces to separate.
- Default:
- class – CSS classes to apply to the menu.
- Default:
vertical medium-horizontal. - Options:
vertical,medium-vertical,large-vertical,horizontal,medium-horizontal,large-horizontal. Allows multiple values. Use spaces to separate.
- Default:
- widget – Whether to wrap the menu in a widget container.
- Default:
on. - Options:
onoroff. Specify one only.
- Default:
- widget_title – The title to display above the menu when
widgetison.- Options: Any text value
Example Usage
[menu theme_location="main-nav" name="Main Menu" class="vertical medium-horizontal" type="accordion medium-dropdown"]
Results
| Example: This shortcode is used to display a customizable navigation menu registered under the main-nav theme location with the name Main Menu, with classes vertical medium-horizontal, the data-responsive-menu attribute is added to the <ul> element with the value accordion medium-dropdown. |
theme_location corresponds to a registered menu location in your theme.Widget Integration: The widget wrapper is useful for integrating the menu into sidebar widgets with a title.