Forked from braginteractive/bootstrap-walker-menu.php
Created
March 17, 2018 16:25
-
-
Save arvindsvt/4d7cde7eac9e29268929962242ce2301 to your computer and use it in GitHub Desktop.
WordPress Walker Menu for Bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav role="navigation" id="navbar-main"> | |
<div class="navbar navbar-inverse navbar-fixed-top"> | |
<div class="container"> | |
<!-- .navbar-toggle is used as the toggle for collapsed navbar content --> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
<a class="navbar-brand" href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="homepage"><?php bloginfo( 'name' ) ?></a> | |
</div> | |
<div class="navbar-collapse collapse navbar-responsive-collapse"> | |
<?php | |
$args = array( | |
'theme_location' => 'primary', | |
'depth' => 2, | |
'container' => false, | |
'menu_class' => 'nav navbar-nav', | |
'walker' => new Bootstrap_Walker_Nav_Menu() | |
); | |
if (has_nav_menu('primary')) { | |
wp_nav_menu($args); | |
} | |
?> | |
</div> | |
</div> | |
</div> | |
</nav> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment