Forked from zzramesses/Off-Canvas WordPress Menu Output
Created
October 3, 2015 12:44
-
-
Save zs-sz/386e863bfd69aa2f8c3f 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