'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 <a>
'after' => '', // after each link </a>
'link_before' => '', // before each link text
));
}
}
-
// 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 <a>
+ 'after' => '', // after each link </a>
+ '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
</section>
</nav>
<aside class="left-off-canvas-menu">
- <ul class="left-off-canvas-list">
- <li><a href="index.html">Home</a></li>
- <li><a href="#">Building Materials</a></li>
- <li><a href="#">Window & Door</a></li>
- <li><a href="#">Kitchen & Bath</a></li>
- <li><a href="#">Builder Services</a></li>
- <li class="has-dropdown"><a href="#">About Us</a>
- <ul class="dropdown">
- <li><a href="#">Meet Us</a></li>
- <li><a href="#">History</a></li>
- <li><a href="#">Find Us</a></li>
- <li><a href="#">Form & Applications</a></li>
- <li><a href="#">Testimonials</a></li>
- <li><a href="#">Reference/Links</a></li>
- <li><a href="#">Employment Applications</a></li>
- </ul>
- </li>
- </ul>
+ <?php foundationPress_mobile_off_canvas(); ?>
</aside>
</header>
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 );
$item_html = '';
parent::start_el( $item_html, $object, $depth, $args );
- $output .= ( $depth == 0 ) ? '<li class="divider"></li>' : '';
+ //$output .= ( $depth == 0 ) ? '<li class="divider"></li>' : '';
$classes = empty( $object->classes ) ? array() : (array) $object->classes;