function start_lvl(&$output, $depth, $args = array()) { global $subnaviditeration; // If we are at a parent element, output this code to start a new div.w-row with the correct 'navid[#]-sub' id if (0 == $depth) { $output .= sprintf("\n<div class='w-row topsubnav' id='navid%d-sub'>\n\t\t\t\n<div class='w-col w-col-3 w-col-small-3 dropdown-leftcol'>\n\t\t\t\n<ul class='w-list-unstyled dropdown-list'>", $subnaviditeration); } parent::start_lvl($output, $depth, $args); // runs the start_lvl function in the parent class (Walker) }