How to Output a WordPress Menu Section

This article will take you through displaying sections of a menu or submenu using the JC Submenu WordPress Plugin via inbuilt Widgets, Shortcodes, and Actions.

Menu Section Widget

JC Submenu plugins comes with a widget titled “Section Menu Widget” which allows you to output a section of your wordpress menu within a sidebar.

It is located under Appearance > Widgets in your wordpress administration area.

JC Submenu - Menu Section Widget

JC Submenu – Menu Section Widget

Widget Settings

  1. Choose Section Menu widget from the list of avaliable widgets
  2. Select Menu Part – Choose the menu section you wish display
  3. Menu Depth – Set how many levels of the menu you wish to display
  4. Show Parent – Choose whether to display the parent item

Menu Section Action

JC Submenu plugin comes with a built in wordpress action to easily output a section of a menu anywhere within your theme.

<?php
do_action( 'jcs/menu_section' , $menu, $args = array() );
?>
  • hierarchy – Whether to display a flat list instead
  • start – Menu item you wish to display from
  • depth – Amount of levels you wish to display
  • show_parent – Whether to display the parent item
  • menu_class – Set the class of the menu element
  • menu_id – Set the id of the menu element
  • container – what to wrap the ul in
  • container_id – Set the id of the container element
  • container_class – Set the class of the container element

Menu Section Shortcode

Display a section of your wordpress menu within your visual editor using wordpress shortcodes.

[jcs_menu_section menu="" hierarchy="1" start="1" depth="5" show_parent="0" /]
  • menu – Choose the menu you wish to display
  • hierarchy – Whether to display a flat list instead
  • start – ID Menu item you wish to display from (can be found by hovering over the menu item within the wordpress menu admin page)
  • depth – Amount of levels you wish to display
  • show_parent – Whether to display the parent item