Since v1.4. Currently in Beta
Overview
Bellows Menu Section functionality allows you to display just a section or slice of a multi-level static menu (created in Appearance > Menus), as defined by a root menu item. The root can be defined statically (by menu item ID) or dynamically (based on the current page), and you have the option to include the root item within the menu section display.
Bellows Section Shortcode
bellows_section
This shortcode allows you to display a section of a static menu
config_id
Default:
main
menu
root
current
– the menu item matching the current pagecurrent_parent
– the parent of the current menu itemcurrent_root
– the top level ancestor of the current menu iteminclude_root
Default:
false
How to display only a section of a menu: Examples
For these examples, let’s assume we have the following menu structure for a Continent > Country > Location menu. The ID of this menu is 27 and we’ll be working with the Main configuration for simplicity.
For the purposes of this example, we’re viewing the “Colorado” page on the front end. With only the current submenu open, the entire menu would look like this:
Here are some examples of how we can splice some sections that include “Colorado”:
Example 1: Statically defined section
Display just the “United States” section of the menu, statically defined by its ID
[bellows_section menu="27" root="52" include_root="true"]
The menu item ID of “United States” is 52, so we are setting the root to the static value of 52.
This shortcode will display the same contents no matter what page we’re viewing, because the root is statically defined.
Example 2: Dynamic section, parent of the current menu item
Display just this section of the menu (Country) including the parent (United States) dynamically based on the current page
[bellows_section menu="27" root="current_parent" include_root="true"]
Because the root here is dynamic, the displayed section of the menu will change depending on the page we’re viewing.
Example 3: Dynamic section, top level from current menu item
Display the entire continent (section of the menu defined by this page’s root item)
[bellows_section menu="27" root="current_root" include_root="true" ]
Example 4: Dynamic section, excluding top level item, from current menu item
Display the entire continent, but without the root item (“North America”) present
[bellows_section menu="27" root="current_root" include_root="false" ]