I faced same issue in my theme and I have saw your theme file to be sure from few things:
- you didn’t have the Navwalker file in your theme. (Navwalker.php)
- Navwalker doesn’t need any js file.
- you need to search for clean copy of Navwalker which allow (Multiple Levels) as you asked.
the solution:
use this copy: craftnce-agency-wordpress-theme
- Just copy the nav walker code from here and make a file in your project and paste it there, e.g: in css folder file name (nacwalker.php)
- go your function file in your theme and add this
require_once get_template_directory() . '/css/nacwalker.php';
add this code in your header:
wp_nav_menu(array(
'theme_location' => 'primary',
'menu_class' => '',
'menu-container' => 'false',
'fallback_cb' => '__return_false',
'items_wrap' => '<ul id="%1$s" class="navbar-nav ms-auto mb-2 mb-lg-0 text-sm %2$s">%3$s</ul>',
'depth' => 2,
'walker' => new craftnce_wp_nav_menu_walker(),
));
then you are ready. no need to any js file. and the styling is easy.