Last active
August 29, 2015 14:09
-
-
Save fovoc/10fe789eed6d4a2ebf79 to your computer and use it in GitHub Desktop.
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
<?php | |
function replace_secondary_menu() { | |
global $ss_menus; | |
// remove secondary navbar as added in /framework/bootstrap/includes/class-Shoestrap_Menus.php#L22 | |
remove_action( 'shoestrap_pre_wrap', array( $ss_menus, 'secondary_navbar' ) ); | |
// add our new navbar on top of Jumbotron area | |
add_action( 'shoestrap_pre_wrap', 'my_secondary_navbar', 1 ); | |
} | |
add_action( 'wp', 'replace_secondary_menu' ); | |
function my_secondary_navbar() { | |
// this is a copy of /framework/bootstrap/includes/class-Shoestrap_Menus.php#L248 | |
// we simply remove the wrapper with the container class for a full-width navbar under a wide layout | |
global $ss_settings, $ss_framework, $ss_menus; | |
if ( has_nav_menu( 'secondary_navigation' ) ) : ?> | |
<header class="secondary navbar navbar-default <?php echo $ss_menus::navbar_class( 'secondary' ); ?>" role="banner"> | |
<button data-target=".nav-secondary" data-toggle="collapse" type="button" class="navbar-toggle"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
<?php | |
if ( $ss_settings['navbar_secondary_social'] != 0 ) { | |
SS_Framework_Bootstrap::navbar_social_links(); | |
} ?> | |
<nav class="nav-secondary navbar-collapse collapse" role="navigation"> | |
<?php wp_nav_menu( array( 'theme_location' => 'secondary_navigation', 'menu_class' => apply_filters( 'shoestrap_nav_class', 'navbar-nav nav' ) ) ); ?> | |
</nav> | |
</header> | |
<?php endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment