start_lvl on Walker is not working

Your menu doesn’t appear to have any levels. start_lvl and end_lvl are used for the sub-menu wrappers. The outer wrapper for the menu, the <ul> is defined by the items_wrap argument of wp_nav_menu():

wp_nav_menu(
    [
        'walker'     => new My_Walker(),
        'items_wrap' => '<nav id="%1$s" class="%2$s">%3$s</nav>',
    ]
);

Leave a Comment