Understrap: Navwalker no longer working in 0.8.4

Created on 23 Jul 2018  路  4Comments  路  Source: understrap/understrap

Issue is about..

  • [x] a Bug Report
  • [ ] a Feature Request
  • [ ] a Suggestion
  • [ ] a Question
  • [x] I need help

Environment:

  • WordPress Version: 4.9.x

Aftre upgrading to 0.8.4 the navwalker stops working. The menu's are there, i can see them in the markup, only the carots disappear and the menu no longer "drops down".

Markup looks as follows:

0.8.2:
<a title="Onderwerpen" href="#" data-toggle="dropdown" class="nav-link dropdown-toggle">Onderwerpen <span class="caret"></span></a>

0.8.4
<a title="Onderwerpen" href="_link to page_" class="nav-link">Onderwerpen</a>

I tried changing my wp_nav_menu to fit the changed walker but this didn't work.

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'collapse navbar-collapse', 'container_id' => 'navbarNavDropdown2', 'menu_class' => 'navbar-nav top-menu', 'fallback_cb' => '', 'menu_id' => 'main-menu', 'walker' => new Understrap_WP_Bootstrap_Navwalker() ) ); ?>

Most helpful comment

Hi, I had the same problem, and after an hour of headbanging against the wall I think I've found the solution: you have to add the "depth" argument (i.e. "depth" => 2).
Hope this helps!

All 4 comments

I ran into the same / a similar issue for the same upgrade from 0.8.2 to 0.8.4.
In my case this was caused by a custom header.php file in my child theme that wasn't updated to use the new wp_nav_menu() Walker, i.e. Understrap_WP_Bootstrap_Navwalker, ref changeset

Yeah, i thought this would be my problem is well but it doens't seem like it. I already updated my menu in my custom header.php to fit the walker, i.e.:

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'collapse navbar-collapse', 'container_id' => 'navbarNavDropdown2', 'menu_class' => 'navbar-nav top-menu', 'fallback_cb' => '', 'menu_id' => 'main-menu', 'walker' => new Understrap_WP_Bootstrap_Navwalker() ) ); ?>

Both capital u and lowercase U do nothing here.

Forgot to mention that in the original question. Added it now. :)

Hi, I had the same problem, and after an hour of headbanging against the wall I think I've found the solution: you have to add the "depth" argument (i.e. "depth" => 2).
Hope this helps!

@marcomagnano You just saved me a lot of headbanging against the wall! That was exactly it. Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidshq picture davidshq  路  3Comments

shansmith01 picture shansmith01  路  5Comments

virtualimage picture virtualimage  路  3Comments

ibanner picture ibanner  路  5Comments

fahaddsheikh picture fahaddsheikh  路  5Comments