Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // bootstrap menu dynamic in wordpress
- <!-- bootstrap nav to wp basic nav -->
- <!-- nav function -->
- <?php
- add_theme_support( 'menu' );
- function register_theme_menu(){
- register_nav_menus(
- array(
- 'header-men' => __( 'Header menu' )
- )
- );
- }
- add_action('init','register_theme_menu');
- ?>
- <!-- show nav in front-end -->
- <nav class="navbar navbar-default" role="navigation">
- <div class="container-fluid">
- <!-- Brand and toggle get grouped for better mobile display -->
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="#">Brand</a>
- </div>
- <!-- Collect the nav links, forms, and other content for toggling -->
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
- <!-- dynamic menu form wp -->
- <?php
- $args = array(
- 'menu' => 'header-menu',
- 'menu_class' => 'nav navbar-nav',
- 'container' => 'flase',
- );
- wp_nav_menu( $args );
- ?>
- <!-- dynamic menu form wp -->
- </div><!-- /.navbar-collapse -->
- </div><!-- /.container-fluid -->
- </nav>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement