wp_nav_menu, walker class, categories as classes of li

your walker class is almost perfect for what you need @Gab.

instead of line 21:

        $output     .= '<li>';

move it down just before line 38

$output .= apply_filters(
        'walker_nav_menu_start_el' [...]

and change it to something like

$output .= $indent . '<li id="nav-menu-item-'. $item->ID . '" class="'. $title . '">';

and you should have the category name as the first class of your li’s

You see, because you’ve built the nice title $title you can use it to build the li tag, and then build the a tag as you had before.


edit:

 $mycatid = $item->object_id;
 $category = get_category($mycatid );
 $mycatslug = $category->slug;
 $output .= $indent . '<li id="nav-menu-item-'. $item->ID . '" class="'. $mycatslug . '">';