Skip to content

Instantly share code, notes, and snippets.

@likesalmon
Created February 2, 2015 21:27
Show Gist options
  • Save likesalmon/4a7c64a8d11a59fa1ccd to your computer and use it in GitHub Desktop.
Save likesalmon/4a7c64a8d11a59fa1ccd to your computer and use it in GitHub Desktop.
Add a "dropdown" class to the sub-nav ul element for Foundation off canvas nav menus. For use with the wp_nav_menu() Walker argument.
/*
Add a "dropdown" class to the sub-nav ul element for Foundation off canvas nav menus
*/
class Foundation_Offcanvas_Walker_Nav_Menu extends Walker_Nav_Menu {
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"right-submenu\">\n";
$output .= '<li class="back"><a href="#">Back</a></li>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment