From: Anthony Talarico Date: Thu, 9 Aug 2018 16:42:56 +0000 (-0400) Subject: updating the glm get top bar function to compose the topbar of all menu locations X-Git-Tag: v1.0.0^2~100 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=10b09452daf0df00e29c160a5ae428511e05e556;p=WP-Themes%2Fcharemisd.git updating the glm get top bar function to compose the topbar of all menu locations --- diff --git a/lib/navigation.php b/lib/navigation.php index 6f3c825..83c05cb 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -20,33 +20,34 @@ register_nav_menus(array( if ( ! function_exists( 'glm_theme_top_bar' ) ) { function glm_theme_top_bar() { echo ''; } } -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 - '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() - )); - } -} +// 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 +// '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() +// )); +// } +// } 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']);