Open robertandrews opened 6 years ago
Hey @robertandrews,
I know it's been a very long time since you posted this and I am sorry for not getting around to responding. In it's current state the navwalker doesn't handle the situation you need very well (at all really) but I have been looking into adding filters/toggles for changing the markup here and plan to work on the updated walker very soon.
I realise this has come around much too late for your needs but I am going to work on something similar to this in the coming weeks and may use this issue to track some progress.
Thanks for opening this issue and I do hope you were able to get a solution for it back at the time.
Hi @pattonwebz - thanks for the reply :-) I did not go ahead with implementing that specific theme and am currently building my own, which is essentially nothing much on top of Bootstrap 4. I can't recall the specifics of my post, so not sure whether this was edge case for you anyway or something that would have been a useful inclusion.
Currently running https://github.com/dupkey/bs4navwalker during the build - maybe I should give this one a try, too. Thanks for responding.
I am using Bootstrap 4 Navwalker to step through my WordPress menu items and generate a navbar, like...
Single level - works
This correctly generates a navbar like ...
Multi-level - preferred
The problem happens when it comes to drop-down/sub-menu items...
My theme handles those like this...
... That is, it:
<span>
with.hide-menu
inside the top-level link<a>
<ul>
unordered list afterward.This is the approach I want to stick to.
Multi-level: what navwalker gives
However, when using the navwalker, I get...
That is, it...
<div>
with.dropdown-menu
inside the<a>
, instead of a<span>
with.hide-menu
<a>
elementsI'm sure this is standard Bootstrap 4 behaviour - in fact, I have happily used it this way on a different site. However, it's not what is needed by the Bootstrap 4 theme which I have purchased and am currently trying to turn in to a WordPress theme...
The question
How can I use the navwalker but in a way that will present drop-down/sub-menu items in a manner consistent with my theme... ?