From: Anthony Talarico Date: Mon, 14 Mar 2016 13:13:45 +0000 (-0400) Subject: added nav menu for header links, added navigation conditional to separate menus X-Git-Tag: v1.0.0^2~102 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d054b4bcc25c10a13314b8207d05b43ce7aa6685;p=WP-Themes%2FDiscoverKZOO.git added nav menu for header links, added navigation conditional to separate menus --- diff --git a/header.php b/header.php index f873a16..2ccd5bf 100644 --- a/header.php +++ b/header.php @@ -19,16 +19,20 @@ #DiscoverKZoo
+ +
diff --git a/index.php b/index.php index da2a5cc..1d70b92 100644 --- a/index.php +++ b/index.php @@ -15,7 +15,7 @@
- +
diff --git a/lib/navigation.php b/lib/navigation.php index f30080c..2987f7c 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -1,7 +1,7 @@ 'Site Navigation', + 'top-bar' => 'Site Navigation', 'top-links' => 'Header Links' )); @@ -26,6 +26,24 @@ if ( ! function_exists( 'glm_theme_top_bar' ) ) { )); } } +if ( ! function_exists( 'glm_theme_top_links' ) ) { + function glm_theme_top_links() { + 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-links', // 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' => 1, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'walker' => new Glm_Theme_Top_Bar_Walker() + )); + } +} /** * Mobile off-canvas @@ -167,12 +185,17 @@ function glm_get_menu_options() function glm_side_menu($mobile = false) { global $post; - // do not use appearance menu for the following page ID's or their ancestors + $sideMenu = $allMenu = $pageMenuId = array(); +// do not use appearance menu for the following page ID's or their ancestors if( !is_page(array(3200, 3201,3202,3203)) && !is_tree(3200) && !is_tree(3201) && !is_tree(3202) && !is_tree(3203)) { - $sideMenu = $allMenu = $pageMenuId = array(); if (($locations = get_nav_menu_locations()) && isset($locations['top-bar'])) { - $menu = wp_get_nav_menu_object($locations['top-bar']); + $menu = wp_get_nav_menu_object($locations['top-bar']); + } + } else { + if (($locations = get_nav_menu_locations()) && isset($locations['top-links'])) { + $menu = wp_get_nav_menu_object($locations['top-links']); } + } $menu_items = wp_get_nav_menu_items($menu->term_id); foreach ((array) $menu_items as $key => $menu_item) { $sideMenu[$menu_item->menu_item_parent][] = $menu_item; @@ -243,21 +266,21 @@ function glm_side_menu($mobile = false) { } echo ''; // using page menu here for the listed page ID's above - } else { - - $parents = get_post_ancestors($post->ID); - $id = ($parents) ? $parents[count($parents)-1]: $post->ID; - $parent = get_page( $id ); - if ($id == 0) { - $ID = $post->ID; - } else { - $ID = $parent->ID; - } - echo '

'.get_the_title($ID).'

'; - echo ''."\n"; - } +// } else { +// +// $parents = get_post_ancestors($post->ID); +// $id = ($parents) ? $parents[count($parents)-1]: $post->ID; +// $parent = get_page( $id ); +// if ($id == 0) { +// $ID = $post->ID; +// } else { +// $ID = $parent->ID; +// } +// echo '

'.get_the_title($ID).'

'; +// echo ''."\n"; +// } } diff --git a/scss/_blog.scss b/scss/_blog.scss index a7963ae..cdc483c 100644 --- a/scss/_blog.scss +++ b/scss/_blog.scss @@ -232,4 +232,4 @@ article { } .addthis_counter.addthis_pill_style{ float: right; -} \ No newline at end of file +}