Skip to content

Instantly share code, notes, and snippets.

@jonbellah
Last active August 29, 2015 14:01
Show Gist options
  • Save jonbellah/1c2b25c9e511a1f3c19e to your computer and use it in GitHub Desktop.
Save jonbellah/1c2b25c9e511a1f3c19e to your computer and use it in GitHub Desktop.
bootstrap nav walker header
<header id="masthead" class="site-header navbar" role="banner" itemscope="itemscope" itemtype="http://schema.org/WPHeader">
<div class="container">
<div class="row">
<div class="navbar-header">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home" class="navbar-brand"><?php bloginfo( 'name' ); ?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<?php /* Primary navigation */
wp_nav_menu( array(
'theme_location' => 'primary',
'depth' => 2,
'container' => false,
'menu_class' => 'nav navbar-nav',
//Process nav menu using our custom nav walker
'walker' => new wp_bootstrap_navwalker())
);
?>
</div>
</div><!-- .row -->
</div><!-- .container -->
</header><!-- .site-header -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment