updating the glm get top bar function to compose the topbar of all menu locations
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 9 Aug 2018 16:42:56 +0000 (12:42 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 9 Aug 2018 16:42:56 +0000 (12:42 -0400)
lib/navigation.php

index 6f3c825..83c05cb 100644 (file)
@@ -20,33 +20,34 @@ register_nav_menus(array(
 if ( ! function_exists( 'glm_theme_top_bar' ) ) {
     function glm_theme_top_bar() {
         echo '<ul>';
+        echo glm_get_top_bar_nav_menu( 'about-menu' );
+        echo glm_get_top_bar_nav_menu( 'district-menu' );
         echo glm_get_top_bar_nav_menu( 'students-menu' );
         echo glm_get_top_bar_nav_menu( 'parents-menu' );
         echo glm_get_top_bar_nav_menu( 'parents-menu' );
         echo glm_get_top_bar_nav_menu( 'professionals-menu' );
-        echo glm_get_top_bar_nav_menu( 'district-menu' );
         echo glm_get_top_bar_nav_menu( 'latest-menu' );
         echo '</ul>';
     }
 }
-if ( ! function_exists( 'glm_theme_top_bar' ) ) {
-  function glm_theme_top_bar() {
-      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' => 'top-bar',                  // where it's located in the theme
-          'before' => '',                                 // before each link <a>
-          'after' => '',                                  // after each link </a>
-          '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()
-      ));
-  }
-}
+// if ( ! function_exists( 'glm_theme_top_bar' ) ) {
+//   function glm_theme_top_bar() {
+//       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' => 'top-bar',                  // where it's located in the theme
+//           'before' => '',                                 // before each link <a>
+//           'after' => '',                                  // after each link </a>
+//           '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()
+//       ));
+//   }
+// }
 
 function glm_get_top_bar_nav_menu( $theme_location )
 {
@@ -220,6 +221,11 @@ function glm_side_menu($mobile = false, $title = false) {
                 $menu       = wp_get_nav_menu_object($locations['district-menu']);
             }
         }
+        if(is_page(45) || 45 == $post->post_parent || is_tree(45)){
+            if (($locations = get_nav_menu_locations()) && isset($locations['about-menu'])) {
+                $menu       = wp_get_nav_menu_object($locations['about-menu']);
+            }
+        }
         if(is_page(59) || 59 == $post->post_parent || is_tree(59)){
             if (($locations = get_nav_menu_locations()) && isset($locations['latest-menu'])) {
                 $menu       = wp_get_nav_menu_object($locations['latest-menu']);