From f1ff5204a3d27d5d91085f30f4bf7d26f8cdc8c9 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Wed, 9 May 2012 01:28:39 -0600 Subject: [PATCH] Add ability to include header without top navbar --- css/app.css | 4 ++-- header.php | 25 +++++++------------------ inc/cleanup.php | 8 ++++++++ inc/config.php | 1 + templates/header-default.php | 11 +++++++++++ templates/header-top-navbar.php | 18 ++++++++++++++++++ 6 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 templates/header-default.php create mode 100644 templates/header-top-navbar.php diff --git a/css/app.css b/css/app.css index 25d0ff8..e0dee85 100644 --- a/css/app.css +++ b/css/app.css @@ -13,7 +13,7 @@ body { } #banner { } /* Fixed Topbar Navigation */ -body { padding-top: 60px; } +body.top-navbar { padding-top: 60px; } body.admin-bar .navbar-fixed-top { top: 28px; } @@ -94,7 +94,7 @@ ol.commentlist img.avatar { float: left; margin-right: 10px; } @media (max-width: 979px) { /* Fix top padding when using the responsive grid with the fixed topbar */ - body { + body.top-navbar { padding-top: 0; } } \ No newline at end of file diff --git a/header.php b/header.php index 05b25b3..2c9b0e4 100644 --- a/header.php +++ b/header.php @@ -25,24 +25,13 @@ - + diff --git a/inc/cleanup.php b/inc/cleanup.php index 4c6747b..15a0518 100644 --- a/inc/cleanup.php +++ b/inc/cleanup.php @@ -611,6 +611,14 @@ function roots_clean_style_tag($input) { return '' . "\n"; } +function roots_body_class_filter($classes) { + if (current_theme_supports('bootstrap-top-navbar')) { + $classes[] = 'top-navbar'; + } + return $classes; +} +add_filter('body_class', 'roots_body_class_filter'); + function roots_body_class() { $term = get_queried_object(); diff --git a/inc/config.php b/inc/config.php index 522dc8e..eb4680a 100644 --- a/inc/config.php +++ b/inc/config.php @@ -4,6 +4,7 @@ add_theme_support('root-relative-urls'); add_theme_support('rewrite-urls'); add_theme_support('h5bp-htaccess'); add_theme_support('bootstrap-responsive'); +add_theme_support('bootstrap-top-navbar'); // Set the content width based on the theme's design and stylesheet if (!isset($content_width)) { $content_width = 940; } diff --git a/templates/header-default.php b/templates/header-default.php new file mode 100644 index 0000000..c711738 --- /dev/null +++ b/templates/header-default.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/templates/header-top-navbar.php b/templates/header-top-navbar.php new file mode 100644 index 0000000..b3e81b4 --- /dev/null +++ b/templates/header-top-navbar.php @@ -0,0 +1,18 @@ + \ No newline at end of file