Skip to content

Instantly share code, notes, and snippets.

@johnny-bit
Forked from storm2k/bootstrap-nav.php
Created May 26, 2015 08:55
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnny-bit/cc8840f148da01c2af52 to your computer and use it in GitHub Desktop.
Save johnny-bit/cc8840f148da01c2af52 to your computer and use it in GitHub Desktop.
<?php
// For use with Sagextras (https://github.com/storm2k/sagextras)
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?= esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a>
</div>
<nav class="collapse navbar-collapse" role="navigation">
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav']);
endif;
?>
</nav>
</div>
</header>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment