it works now
authorIan Weller <ian@gaslightmedia.com>
Thu, 13 Nov 2014 18:05:09 +0000 (13:05 -0500)
committerIan Weller <ian@gaslightmedia.com>
Thu, 13 Nov 2014 18:05:09 +0000 (13:05 -0500)
functions.php
header.php
library/top-bar_walker.php

index 18b3851..e2ae5a2 100755 (executable)
@@ -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 <a> 
                'after' => '',                                  // after each link </a>
                '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 <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
index 60a16ce..5fa180d 100644 (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>
     
index 8218dd5..01b17c3 100644 (file)
@@ -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 ) ? '<li class="divider"></li>' : '';
+        //$output .= ( $depth == 0 ) ? '<li class="divider"></li>' : '';
         
         $classes = empty( $object->classes ) ? array() : (array) $object->classes;