I have customised my menu in wordpress by extending the Nav_Menu_Walker class and now i cannot figure it out how could i add a class at a specific ul element. I have this function which adds classes by depth:
function start_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
if ($depth >= 1)
$output .= "\n$indent<ul class=\"subsubmenu\">\n";
else
$output .= "\n$indent<ul class=\"submenu\">\n";
}
When the $depth is 0 i would like to add a different class at the third element from $depth =0 rather than "submenu".
Could you please provide me some suggestions ?
depth
0, 1 or many? Or on the third submenu with adepth == 0
?