I’m trying to integrate the bootstrap navbar dropdown with WordPress. I already have the navbar working perfectly. But when I try to add a new category/page as a submenu, the layout break, with an “ul” element with decoration (dot) and has no dropdown hover effect. I tried the code from nav walker but didn’t work. If have some way to make it without nav walker too, it’d be good.
3 comments
Comments are closed.
Try using this navwalker you can put into your theme.
https://github.com/twittem/wp-bootstrap-navwalker
Here an alternate solution for https://github.com/twittem/wp-bootstrap-navwalker
Usage:
Add menu_class
nav
ornavbar-nav
This can be done more simply with some jquery, but it’s not too elegant and i bet is not recommended either. You could check to see what class wp adds to your ul element and based on that do some logic, something like: