Skip to content

Commit

Permalink
Offer just one header, the BS top navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed Apr 1, 2014
1 parent be14fdb commit b4c7b9b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 33 deletions.
7 changes: 1 addition & 6 deletions base.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@

<?php
do_action('get_header');
// Use Bootstrap's navbar if enabled in config.php
if (current_theme_supports('bootstrap-top-navbar')) {
get_template_part('templates/header-top-navbar');
} else {
get_template_part('templates/header');
}
get_template_part('templates/header');
?>

<div class="wrap container" role="document">
Expand Down
1 change: 0 additions & 1 deletion lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
add_theme_support('soil-clean-up'); // Enable clean up from Soil
add_theme_support('soil-relative-urls'); // Enable relative URLs from Soil
add_theme_support('soil-nice-search'); // Enable /?s= to /search/ redirect from Soil
add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's top navbar
add_theme_support('bootstrap-gallery'); // Enable Bootstrap's thumbnails component on [gallery]
add_theme_support('jquery-cdn'); // Enable to load jQuery from the Google CDN

Expand Down
2 changes: 1 addition & 1 deletion lib/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function roots_nav_menu_args($args = '') {
$roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
}

if (current_theme_supports('bootstrap-top-navbar') && !$args['depth']) {
if (!$args['depth']) {
$roots_nav_menu_args['depth'] = 2;
}

Expand Down
21 changes: 0 additions & 21 deletions templates/header-top-navbar.php

This file was deleted.

17 changes: 13 additions & 4 deletions templates/header.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<header class="banner" role="banner">
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<a class="brand" href="<?php echo home_url('/') ?>"><?php bloginfo('name'); ?></a>
<nav class="nav-main" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a>
</div>

<nav class="collapse navbar-collapse" role="navigation">
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav nav-pills'));
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav'));
endif;
?>
</nav>
Expand Down

0 comments on commit b4c7b9b

Please sign in to comment.