How to customize wp-bootstrap-navwalker in wordpress
The wordpress way would be to add 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
to wp_nav_menu(array( ))
then you will have special class for custom nav items and normal links items. Then you can target them from CSS.
Usefull link: wp_nav_items css
Otherwise you need to change: wp_bootstrap_navwalker
Related videos on Youtube
Daniel
you can see my portfolio here : http://themeforest.net/user/crown_technologies
Updated on June 04, 2022Comments
-
Daniel over 1 year
I'm trying to use wp-bootstrap-navwalker to customize my navigation.
here is the example of my current static code
<div class="collapse navbar-collapse"> <ul class="navbar-nav nav navbar-right"> <li><a class="menu" href="index-2.html">home</a></li> <li><a class="menu" href="#">travel</a></li> <li><a class="menu" href="#">lifestyle</a></li> <li><a class="menu" href="about.html">about me</a></li> <li><a class="last-menu" href="contact.html">contact</a></li> </ul> </div>
I'm using this wp-bootstrap-navwalker to make it dynamic
wp_nav_menu( array( 'menu' => 'primary', 'theme_location' => 'primary', 'depth' => 2, 'container' => 'div', 'container_class' => 'collapse navbar-collapse', 'menu_class' => 'nav navbar-nav navbar-right', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker()) );
Which is working perfectly fine. Now i have a problem, That i have
menu
class inside my<a class="menu">home</a>
. How can i putmenu
class inside my anchor tag if that data is coming dynamically. Is there any way that we can customize thiswp_nav_menu(array( ));
?-
Nathan Dawson almost 7 yearsIs
wp_bootstrap_navwalker()
overriding thestart_el
method?
-