Merge pull request #828 from gillespieza/simplify-sidebars
Tidy up left sidebar check
thx @gillespieza !
It took a moment before I get it ;-)
.col-md will autofill all available space. So we don´t need to check how much ist left.
👍
This commit is contained in:
commit
dc197a621e
|
@ -18,26 +18,4 @@ $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' );
|
|||
<?php get_template_part( 'sidebar-templates/sidebar', 'left' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$html = '';
|
||||
if ( 'right' === $sidebar_pos || 'left' === $sidebar_pos ) {
|
||||
$html = '<div class="';
|
||||
if ( ( is_active_sidebar( 'right-sidebar' ) && 'right' === $sidebar_pos ) || ( is_active_sidebar( 'left-sidebar' ) && 'left' === $sidebar_pos ) ) {
|
||||
$html .= 'col-md-8 content-area" id="primary">';
|
||||
} else {
|
||||
$html .= 'col-md-12 content-area" id="primary">';
|
||||
}
|
||||
echo $html; // WPCS: XSS OK.
|
||||
} elseif ( 'both' === $sidebar_pos ) {
|
||||
$html = '<div class="';
|
||||
if ( is_active_sidebar( 'right-sidebar' ) && is_active_sidebar( 'left-sidebar' ) ) {
|
||||
$html .= 'col-md-6 content-area" id="primary">';
|
||||
} elseif ( is_active_sidebar( 'right-sidebar' ) || is_active_sidebar( 'left-sidebar' ) ) {
|
||||
$html .= 'col-md-8 content-area" id="primary">';
|
||||
} else {
|
||||
$html .= 'col-md-12 content-area" id="primary">';
|
||||
}
|
||||
echo $html; // WPCS: XSS OK.
|
||||
} else {
|
||||
echo '<div class="col-md-12 content-area" id="primary">';
|
||||
}
|
||||
<div class="col-md content-area" id="primary">
|
||||
|
|
Reference in New Issue