I am using WordPress Dropdown Menu With Bootstrap ( http://astronautweb.co/2012/10/wordpress-dropdown-bootstrap/ ). I have added this to my WordPress theme.
I have to add the social sharing icons div to the code before the div in the wp_nav_menu closes. Otherwise, navbar-right div goes down. How can I add this to wp_nav_menu? I mean what shall I do if I want to add something else or something more? For example, if I want to add “Hello” before the div that wp_nav_menu created closes, how am I going to do this?
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 2,
'container' => 'div',
'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
'walker' => new wp_bootstrap_navwalker())
);
?>
<div class="navbar-right">
<button type="button" class="btn btn-twitter navbar-btn"><i class="icon-twitter"></i></button>
<button type="button" class="btn btn-facebook navbar-btn"><i class="icon-facebook"></i></button>
<button type="button" class="btn btn-foursquare navbar-btn"><i class="icon-foursquare"></i></button>
</div>
I see the tutorial you listed is using my walker class which should make this pretty easy. The best thing to do is set the
wp_nav_menu()
container to false and manually wrap the menu. I would probably add the social section as a separatewp_nav_menu()
so it’s not hardcoded into the theme.