Forked from zzramesses/Off-Canvas WordPress Menu Output
Last active
August 29, 2015 14:27
-
-
Save tsquez/146af7834c19688bcae0 to your computer and use it in GitHub Desktop.
Foundation Off-Canvas WordPress Menu (forked so I do not lose it)
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