[menu]

The shortcode is designed to render a customizable navigation menu.


Product


Shortcode Attributes

  1. name – The name of the menu to display. If not provided, the theme location is used.
    • Options: Any text value. Specify one only.
  2. 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.
  3. 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.
  4. 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.
  5. widget – Whether to wrap the menu in a widget container.
    • Default: on.
    • Options: on or off. Specify one only.
  6. widget_title – The title to display above the menu when widget is on.
    • 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: Ensure that the 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.