adding off canvas widget

This commit is contained in:
Holger Koenemann 2014-12-19 10:04:55 +01:00
parent 50f5f94e4a
commit 9ed6978b7e
5 changed files with 54 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -18,6 +18,8 @@
<body <?php body_class(); ?>> <body <?php body_class(); ?>>
<div id="page" class="hfeed site"> <div id="page" class="hfeed site">
<!-- ******************* The Navbar Area ******************* --> <!-- ******************* The Navbar Area ******************* -->
@ -31,7 +33,7 @@
<div class="container"> <div class="container">
<div class="col-md-12"> <div class="col-md-<?php if ( is_active_sidebar( 'off-canvas' ) ): ?>11<?php else : ?>12<?php endif; ?>">
<div class="navbar-header"> <div class="navbar-header">
@ -60,12 +62,44 @@
) )
); ?> ); ?>
</div> <!-- .col-md-12 end --> </div> <!-- .col-md-11 end -->
<?php if ( is_active_sidebar( 'off-canvas' ) ): ?>
<div class="col-md-1 text-right">
<!-- Off Canvas Toggle -->
<a class="off-canvas-toggle-link" data-toggle="offcanvas" data-target=".navmenu" data-canvas="body">
menu
</a>
</div>
<?php else : ?>
<?php endif; ?>
</div> <!-- .container --> </div> <!-- .container -->
</div><!-- .navbar --> </div><!-- .navbar -->
<?php if ( is_active_sidebar( 'off-canvas' ) ): ?>
<div class="navmenu navmenu-inverse navmenu-fixed-left offcanvas">
<!-- Off Canvas Toggle -->
<a class="off-canvas-toggle-link" data-toggle="offcanvas" data-target=".navmenu" data-canvas="body">
menu
</a>
<!-- Off Canvas Widget itself -->
<?php dynamic_sidebar( 'off-canvas' ); ?>
</div>
<?php else : ?>
<?php endif; ?>
</nav><!-- .site-navigation --> </nav><!-- .site-navigation -->
</div><!-- .wrapper-navbar end --> </div><!-- .wrapper-navbar end -->

View File

@ -19,5 +19,15 @@ function understrap_widgets_init() {
'before_title' => '', 'before_title' => '',
'after_title' => '', 'after_title' => '',
) ); ) );
register_sidebar( array(
'name' => __( 'Off Canvas', 'understrap' ),
'id' => 'off-canvas',
'description' => '',
'before_widget' => '<div class="col-md-12">',
'after_widget' => '</div>',
'before_title' => '',
'after_title' => '',
) );
} }
add_action( 'widgets_init', 'understrap_widgets_init' ); add_action( 'widgets_init', 'understrap_widgets_init' );

File diff suppressed because one or more lines are too long

View File

@ -5,3 +5,7 @@ body { padding-top: 50px; }
.sticky, .gallery-caption, .bypostauthor { .sticky, .gallery-caption, .bypostauthor {
font-size:inherit; font-size:inherit;
} }
// Workaround for Jasny off canvas nav on right hand side
.navmenu-fixed-right {
left: auto !important;
}