Forked from braginteractive/bootstrap-walker-menu.php
Created
February 14, 2020 16:57
-
-
Save Senpai-Codes/4cab4998a053d51267c9b4404939f2cb to your computer and use it in GitHub Desktop.
WordPress Walker Menu for Bootstrap
This file contains hidden or 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