The Genesis secondary navigation, or secondary nav, is the additional menu bar that usually displays immediately below the primary navigation, between the site header and the main content area.
With a Genesis theme, it’s easy to change the position of the secondary navigation to better suit your design, rewrite the function that outputs it or remove it altogether. For example, many Genesis themes reposition the secondary nav to the footer area, and/or remove both navs as part of a Landing Page template.
The function responsible for outputting the secondary navigation is
This function first checks that the child theme supports the Secondary Navigation menu location. If so, it renders the secondary navigation in either the HTML5 or XHTML format depending on the child theme.
genesis_do_subnav is hooked to
genesis_after_header at the default priority 10.
Reposition the Secondary Navigation
Below is the basic code to reposition the secondary navigation to another hook. Just replace
another_hook with the name of your desired hook.
Rewrite the Secondary Navigation
Below is the basic code to rewrite the secondary navigation. Just replace
your_function_here with the name of the function that outputs your content.
Remove the Secondary Navigation
The easiest way to remove the secondary navigation across the whole site is to unassign the menu that is currently assigned to the Secondary Navigation menu location, via the admin area or Customizer. Furthermore, you can prevent the secondary navigation being re-added by removing theme support for the
To remove the secondary navigation under certain circumstances only, below is the basic code that you can use in conjunction with the template hierarchy.
Example 1: reposition the secondary navigation to the footer area.
Example 2: pop the secondary navigation out of the
<div class="site-container"> (HTML5) or
<div id="wrap"> (XHTML) markup element.
The structure of the markup produced by the function
genesis_do_subnav is as follows for HTML5 and XHTML themes respectively.
Genesis Simple Hooks
This function is not unhookable via Genesis Simple Hooks.
There are no filters on the output of this function.
genesis_do_subnav has been included since version 1.0.0.
genesis_do_subnav is located in lib/structure/menu.php.