Local Navigation Menu

Menu Logic That Makes Sense

Local Navigation Menu is a WordPress plugin implemented with a widget that outputs a list of WordPress pages in an unordered list.  We created this plugin due to the high demand of pages with local navigation menus that followed a specific logic structure.  The plugin utilizes the wp_list_pages() function in conjunction with some clever logic to present the user with a one level deep list of child / sibling menu items.

local navigation menu wordpress plugin

While simple in function and application, the plugin shines when used on sites that have menu hierarchies spanning 3 or 4 levels deep.  Still not clear on when to use something like this?  Here are examples:

The Menu Structure

Let’s say we have a site with a ton of pages.  Let’s also pretend the hierarchy of those pages looks like so.

  • Top Level Category 1
  • Top Level Category 2
    • 2nd Level Category 1
    • 2nd Level Category 2
      • 3rd Level Category 1
      • 3rd Level Category 2
      • 3rd Level Category 3
    • 2nd Level Category 3
    • 2nd Level Category 4
  • Top Level Category 3

Not complicated at all.  And in most cases a simple page list like this would do.  But lets say the desire is to only present the user with a menu that is only one level deep.  How do we determine which level to show?

1st Scenario

You are on the 2nd level of a menu and the menu item you are currently on has no children but has siblings.  The plugin will output all the siblings (all 2nd level items).  The title of the menu will be the parent menu’s title (1st level).

2nd Scenario

You are on the 2nd level of a menu and the menu item you are currently on has children and does or does not have siblings.  The plugin will output all the children (3rd level).  The title of the menu will be the page you are on.

3rd Scenario

You are on the 3rd level of a menu and the menu item you are currently on has children and does or does not have siblings.  The plugin will output all the siblings (3rd level).  The title of the menu will be the parent of the page you are on (2nd level).

NOTE: That this logic applies to ALL menu depths regardless of how deep they go.

Let's Talk About Your Project Schedule Free Consultation

Request a FREE Consultation

×