Last active
January 26, 2018 15:05
-
-
Save zzramesses/0e7cd411045e11571448 to your computer and use it in GitHub Desktop.
Foundation Off-Canvas WordPress Menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Off_Canvas_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->has_children ) ? 'has-submenu' : ''; | |
parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); | |
} | |
function start_lvl( &$output, $depth = 0, $args = array() ) { | |
$output .= "\n<ul class=\"left-submenu\">\n"; | |
$output .= "\n<li class=\"back\"><a href=\"#\">Back</a></li>\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks really cool! Going to give it a try, thanks for the effort 😉