left and right sidebars

This commit is contained in:
Stef Kariotidis 2016-11-05 14:35:33 +02:00
parent 108222b383
commit ca8c7374c0
2 changed files with 11 additions and 9 deletions

View File

@ -5,18 +5,19 @@
* @package understrap
*/
if ( ! is_active_sidebar( 'right-sidebar' ) || ! is_active_sidebar( 'right-sidebar' ) ) {
if ( ! is_active_sidebar( 'left-sidebar' ) ) {
return;
}
// when both sidebars turned one, reduce col size to 3 from 4.
// when both sidebars turned on reduce col size to 3 from 4.
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
<?php if ( 'both' === $sidebar_pos ): ?>
<div class="col-md-3 widget-area" id="secondary" role="complementary">
<div class="col-md-3 widget-area" id="'left-sidebar'" role="complementary">
<?php else: ?>
<div class="col-md-4 widget-area" id="secondary" role="complementary">
<div class="col-md-4 widget-area" id="'left-sidebar'" role="complementary">
<?php endif; ?>
<?php dynamic_sidebar( ); ?>
<?php dynamic_sidebar( 'left-sidebar' ); ?>
</div><!-- #secondary -->

View File

@ -1,6 +1,6 @@
<?php
/**
* The sidebar containing the main widget area.
* The right sidebar containing the main widget area.
*
* @package understrap
*/
@ -8,14 +8,15 @@
if ( ! is_active_sidebar( 'right-sidebar' ) ) {
return;
}
// when both sidebars turned one, reduce col size to 3 from 4.
// when both sidebars turned on reduce col size to 3 from 4.
$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
?>
<?php if ( 'both' === $sidebar_pos ): ?>
<div class="col-md-3 widget-area" id="secondary" role="complementary">
<div class="col-md-3 widget-area" id="right-sidebar" role="complementary">
<?php else: ?>
<div class="col-md-4 widget-area" id="secondary" role="complementary">
<div class="col-md-4 widget-area" id="right-sidebar" role="complementary">
<?php endif; ?>
<?php dynamic_sidebar( 'right-sidebar' ); ?>