reversed walker
authorIan Weller <ian@gaslightmedia.com>
Mon, 23 Nov 2015 21:25:57 +0000 (16:25 -0500)
committerIan Weller <ian@gaslightmedia.com>
Mon, 23 Nov 2015 21:25:57 +0000 (16:25 -0500)
lib/menu-walker.php

index 36a8e3c..611e3f3 100644 (file)
@@ -10,14 +10,16 @@ class Feature_Top_Bar_Walker extends Walker_Nav_Menu {
         $element->has_children = ! empty( $children_elements[ $element->ID ] );
         $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
         $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'has-dropdown' : '';
-        $element->classes[] = ( $element->post_parent == 0 && $mainLevelCounter < 8 ) ? '' : 'drop-left';
+        $element->classes[] = ( $element->post_parent == 0 && $mainLevelCounter > 3 ) ? 'drop-left' : '';
         parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
     }
+    
+    
 
     function start_lvl( &$output, $depth = 0, $args = array() ) {
-        
+        if ($depth == 0) {
             $output .= "\n<ul class=\"sub-menu dropdown\">\n";
-        
+        }
     }
 
 }