adding off canvas widget
This commit is contained in:
parent
50f5f94e4a
commit
9ed6978b7e
File diff suppressed because one or more lines are too long
38
header.php
38
header.php
|
@ -18,6 +18,8 @@
|
|||
|
||||
<body <?php body_class(); ?>>
|
||||
|
||||
|
||||
|
||||
<div id="page" class="hfeed site">
|
||||
|
||||
<!-- ******************* The Navbar Area ******************* -->
|
||||
|
@ -31,7 +33,7 @@
|
|||
|
||||
<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">
|
||||
|
||||
|
@ -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><!-- .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 -->
|
||||
|
||||
</div><!-- .wrapper-navbar end -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -19,5 +19,15 @@ function understrap_widgets_init() {
|
|||
'before_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' );
|
File diff suppressed because one or more lines are too long
|
@ -5,3 +5,7 @@ body { padding-top: 50px; }
|
|||
.sticky, .gallery-caption, .bypostauthor {
|
||||
font-size:inherit;
|
||||
}
|
||||
// Workaround for Jasny off canvas nav on right hand side
|
||||
.navmenu-fixed-right {
|
||||
left: auto !important;
|
||||
}
|
Reference in New Issue