[child_menu]

The shortcode is designed to display a menu of child pages for the current page or a specified page. The menu can be displayed as a widget or as a regular block on the page.


Product


Shortcode Attributes

  1. id – The ID of the page for which the child menu should be displayed. If not provided, the ID of the current page will be used.
    • Options: Any numeric value.
  2. widget – Whether to wrap the menu in a widget container.
    • Default: on.
    • Options: on or off. Specify one only.
  3. widget_title – The title to display above the menu when widget is on.
    • Options: Any text value

Example Usage

[child_menu widget="off"]
[child_menu id="123" widget="off"]
[child_menu widget="on" widget_title="Child Pages"]

Results

Example 1:
Display the child menu for the current page without a widget.

Example 2:
Display the child menu for a specific page (by ID) as a regular block.

Example 3:
Display the child menu for the current page as a widget.
The shortcode only works on pages that have child pages. If no child pages are found, nothing will be displayed.
The menu is sorted by menu_order in ascending order.