From e9a2f078420e04ffaea78b9150e34cf981f983e0 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 25 Aug 2015 13:10:01 -0400 Subject: [PATCH] Remove third level navigation items from top menu. --- functions.php | 7 +++++-- lib/navigation.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 6460e58..7518a97 100644 --- a/functions.php +++ b/functions.php @@ -48,7 +48,7 @@ function glm_get_menu_options() * * Grab the top level pages and their sub pages as the main navigation */ -function glm_page_menu($parent = 0, $class = '', $subnav = false, $navImg = null) +function glm_page_menu($parent = 0, $class = '', $subnav = false, $navImg = null, $depth = 0) { $menuConfig = glm_get_menu_options(); $frontPageId = get_option('page_on_front'); @@ -71,7 +71,9 @@ function glm_page_menu($parent = 0, $class = '', $subnav = false, $navImg = null if ($navImg) { echo ''; } + echo '
' . $depth . '
'; foreach ($pages as $page) { + echo '
'."\n"; echo ''.$page->post_title.''."\n"; - echo glm_page_menu($page->ID, 'sub-menu dropdown', true, $navImg); + echo glm_page_menu($page->ID, 'sub-menu dropdown', true, $navImg, $depth+1); echo ''."\n"; } else { echo '
  • '.$page->post_title.'
  • '."\n"; @@ -95,6 +97,7 @@ function glm_page_menu($parent = 0, $class = '', $subnav = false, $navImg = null ++$elemCount; } echo ''."\n"; + } function SearchFilter($query) { diff --git a/lib/navigation.php b/lib/navigation.php index 65b1ed7..0b8e71a 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -20,7 +20,7 @@ if ( ! function_exists( 'emmetcounty_top_bar' ) ) { 'after' => '', // after each link 'link_before' => '', // before each link text 'link_after' => '', // after each link text - 'depth' => 3, // limit the depth of the nav + 'depth' => 2, // limit the depth of the nav 'fallback_cb' => false, // fallback function (see below) 'walker' => new Emmetcounty_Top_Bar_Walker() )); -- 2.17.1