From c18ea538b60d1a956adbe6644d60d02355b94816 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 28 Jan 2016 13:21:15 -0500 Subject: [PATCH] testing off canvas ul removal --- lib/navigation.php | 58 +++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/lib/navigation.php b/lib/navigation.php index 75095b5..10fcdd6 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -26,48 +26,44 @@ if ( ! function_exists( 'glm_theme_top_bar' ) ) { )); } } +function glm_get_mobile_nav_menu( $theme_location ) +{ + $menu = wp_nav_menu(array( + 'echo' => false, // don't echo + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'off-canvas-list', // adding custom nav class + 'theme_location' => $theme_location, // 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' => 5, // limit the depth of the nav + 'fallback_cb' => false, // fallback function (see below) + 'walker' => new Glm_Theme_Off_Canvas_Walker() + )); + return preg_replace( array( '%^]*>%', '%$%' ), '', $menu ); +} /** * Mobile off-canvas */ if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) { function glm_theme_mobile_off_canvas() { - - $menu = wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'off-canvas-list', // 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' => 5, // limit the depth of the nav - 'fallback_cb' => false, // fallback function (see below) - 'walker' => new Glm_Theme_Off_Canvas_Walker() - )); - return preg_replace( array( '%^]*>%', '%$%' ), '', $menu ); + echo '
'; + echo '
  • Home
  • '; + echo glm_get_mobile_nav_menu('top-bar'); + echo '
    '; } } + + if ( ! function_exists( 'glm_topLinks_mobile_off_canvas' ) ) { function glm_topLinks_mobile_off_canvas() { echo '
    '; - wp_nav_menu(array( - 'container' => false, // remove nav container - 'container_class' => '', // class of container - 'menu' => '', // menu name - 'menu_class' => 'off-canvas-list', // adding custom nav class - 'theme_location' => 'header-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' => 5, // limit the depth of the nav - 'fallback_cb' => false, // fallback function (see below) - 'walker' => new Glm_Theme_Off_Canvas_Walker() - )); - echo '
    '; + echo glm_get_mobile_nav_menu('header-bar'); + echo ''; } } /** -- 2.17.1