From 02955979c55ec1e58772d8541ddb4be3226f9400 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Thu, 13 Nov 2014 13:05:09 -0500 Subject: [PATCH] it works now --- functions.php | 25 +++++++++++++++++++++++-- header.php | 19 +------------------ library/top-bar_walker.php | 4 ++-- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/functions.php b/functions.php index 18b3851..e2ae5a2 100755 --- a/functions.php +++ b/functions.php @@ -14,7 +14,7 @@ if ( ! function_exists( 'foundationPress_top_bar_l' ) ) { 'container_class' => '', // class of container 'menu' => '', // menu name 'menu_class' => 'top-bar-menu left', // adding custom nav class - 'theme_location' => 'top-bar-l', // where it's located in the theme + 'theme_location' => '', // where it's located in the theme 'before' => '', // before each link 'after' => '', // after each link 'link_before' => '', // before each link text @@ -25,7 +25,28 @@ if ( ! function_exists( 'foundationPress_top_bar_l' ) ) { )); } } - // Add menu walker require_once('library/top-bar_walker.php'); +/** + * Mobile off-canvas + */ +if ( ! function_exists( 'foundationPress_mobile_off_canvas' ) ) { + function foundationPress_mobile_off_canvas() { + wp_nav_menu(array( + 'container' => false, // remove nav container + 'container_class' => '', // class of container + 'menu' => '', // menu name + 'menu_class' => 'left-off-canvas-list', // adding custom nav class + '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 top_bar_walker() + )); + } +} + ?> \ No newline at end of file diff --git a/header.php b/header.php index 60a16ce..5fa180d 100644 --- a/header.php +++ b/header.php @@ -52,24 +52,7 @@ diff --git a/library/top-bar_walker.php b/library/top-bar_walker.php index 8218dd5..01b17c3 100644 --- a/library/top-bar_walker.php +++ b/library/top-bar_walker.php @@ -7,7 +7,7 @@ class top_bar_walker extends Walker_Nav_Menu { function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { $element->has_children = !empty( $children_elements[$element->ID] ); - $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : ''; + //$element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : ''; $element->classes[] = ( $element->has_children && $max_depth !== 1 ) ? 'has-dropdown' : ''; parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); @@ -17,7 +17,7 @@ class top_bar_walker extends Walker_Nav_Menu { $item_html = ''; parent::start_el( $item_html, $object, $depth, $args ); - $output .= ( $depth == 0 ) ? '
  • ' : ''; + //$output .= ( $depth == 0 ) ? '
  • ' : ''; $classes = empty( $object->classes ) ? array() : (array) $object->classes; -- 2.17.1