Skip to content

Instantly share code, notes, and snippets.

@joelstransky
Created March 3, 2017 23:33
Show Gist options
  • Save joelstransky/58068215834e4414a38e8a182d513ed0 to your computer and use it in GitHub Desktop.
Save joelstransky/58068215834e4414a38e8a182d513ed0 to your computer and use it in GitHub Desktop.
<?php
class F6_DRILL_MENU_WALKER extends Walker_Nav_Menu
{
/*
* Add vertical menu class
*/
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"vertical menu\">\n";
}
}
<?php
require_once 'class-f6-drill-menu-walker.php';
<?php
wp_nav_menu(array(
'container' => false,
'menu' => /* name of your menu */,
'menu_class' => 'vertical menu',
'items_wrap' => '<ul id="%1$s" class="%2$s" data-drilldown="">%3$s</ul>',
'walker' => new F6_DRILL_MENU_WALKER(),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment