From: Ian Weller Date: Fri, 13 Jan 2017 15:34:44 +0000 (-0500) Subject: added a new menu field the right way X-Git-Tag: v1.0.0^2~5 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b0a6bbee3d9033087c3b42dc957af725c2444fdb;p=WP-Themes%2Fdevdemo.git added a new menu field the right way I added a new menu field and I got the function correct this time. --- diff --git a/header.php b/header.php index 7ff18e6..7652e95 100644 --- a/header.php +++ b/header.php @@ -40,10 +40,7 @@
- +
diff --git a/lib/navigation.php b/lib/navigation.php index 5a47e20..abb3814 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -4,7 +4,8 @@ register_nav_menus(array( 'top-bar' => 'Site Navigation', 'footer' => 'Footer Navigation', 'chamber' => 'Chamber Navigation', - 'community' => 'Community Navigation' + 'community' => 'Community Navigation', + 'second-header' => 'Secondary Header Navigation' )); /** @@ -91,6 +92,27 @@ if ( ! function_exists( 'glm_theme_chamber' ) ) { )); } } +/** + * Secondary Header Navigation +**/ +if ( ! function_exists( 'glm_theme_second_header' ) ) { + function glm_theme_second_header() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => '', // adding custom nav class + 'theme_location' => 'second-header', // where it's located in the theme + 'before' => '', // before each link + 'after' => '', // after each link + 'link_before' => '', // before each link text + 'link_after' => '', // after each link text + 'depth' => 3, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'walker' => new Glm_Theme_Top_Bar_Walker() + )); + } +} /** * Mobile off-canvas */