WP Manifestindependent plugin directory
manifest / content / redandblue-subpage-menu

redandblue subpage menu

Plugin for creating (sidebar) hierarchical sub-page navigation.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/redandbluefi/redandblue-subpage-menu/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

redandblue sub-page hierarchical menu

@TODO Better name?

Use case:

  • Building a hierarchical (sidebar) menu for pages with parents / child.
  • Lists child nodes under parent node in separate list.

How to use:

  • Call the function in your page.php / single.php
  • Add custom post type name as an argument if you want to use the menu in a custom post type
  • Add TRUE as a second parameter if you need to display parent title

Example:


<?php $sub_nav = get_subpage_menu('custom_post_type', TRUE); ?>
<?php if ($sub_nav) : ?>
  <section class="sidebar-navigation">
    <ul class="sidebar-navigation__container">
      <?php print_r($sub_nav); ?>
    </ul>
  </section>
<?php endif; ?>