diff --git a/functions.php b/functions.php index 35df8db212..1e71109b9c 100644 --- a/functions.php +++ b/functions.php @@ -10,12 +10,13 @@ * @link https://github.com/roots/sage/pull/1042 */ $sage_includes = [ - 'lib/assets.php', // Scripts and stylesheets - 'lib/extras.php', // Custom functions - 'lib/setup.php', // Theme setup - 'lib/titles.php', // Page titles - 'lib/wrapper.php', // Theme wrapper class - 'lib/customizer.php' // Theme customizer + 'lib/assets.php', // Scripts and stylesheets + 'lib/extras.php', // Custom functions + 'lib/setup.php', // Theme setup + 'lib/titles.php', // Page titles + 'lib/wrapper.php', // Theme wrapper class + 'lib/customizer.php', // Theme customizer + 'lib/wp_bootstrap_nav_walker.php', // Bootstrap Nav Walker ]; foreach ($sage_includes as $file) { diff --git a/lib/setup.php b/lib/setup.php index b9f962d18b..af57f67dd5 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -86,6 +86,7 @@ function display_sidebar() { is_404(), is_front_page(), is_page_template('template-custom.php'), + is_page_template('template-full-width.php'), ]); return apply_filters('sage/display_sidebar', $display); diff --git a/lib/wp_bootstrap_nav_walker.php b/lib/wp_bootstrap_nav_walker.php new file mode 100644 index 0000000000..94d7f9b92f --- /dev/null +++ b/lib/wp_bootstrap_nav_walker.php @@ -0,0 +1,206 @@ +\n"; + } + + /** + * @see Walker::start_el() + * @since 3.0.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param int $current_page Menu item ID. + * @param object $args + */ + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; + + /** + * Dividers, Headers or Disabled + * ============================= + * Determine whether the item is a Divider, Header, Disabled or regular + * menu item. To prevent errors we use the strcasecmp() function to so a + * comparison that is not case sensitive. The strcasecmp() function returns + * a 0 if the strings are equal. + */ + if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) { + $output .= $indent . ''; + $fb_output .= ''; + + if ( $container ) + $fb_output .= ''; + + echo $fb_output; + } + } +} \ No newline at end of file diff --git a/template-full-width.php b/template-full-width.php new file mode 100644 index 0000000000..16d5e95b01 --- /dev/null +++ b/template-full-width.php @@ -0,0 +1,10 @@ + + + + + + diff --git a/templates/header.php b/templates/header.php index a971013f96..3b1d028705 100644 --- a/templates/header.php +++ b/templates/header.php @@ -1,12 +1,22 @@ - + + \ No newline at end of file