Align all templates to do the same left/rigth sidebar check

This commit is contained in:
koenemann 2016-11-14 15:16:24 +01:00
parent f39ea80eef
commit c9787c436a
14 changed files with 114 additions and 38 deletions

View File

@ -10,13 +10,22 @@
get_header();
?>
<?php
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<?php get_template_part( 'global-templates/variables', 'none' ); ?>
<div class="wrapper" id="archive-wrapper">
<div class="container" id="content">
<div class="<?php echo $container?>" id="content">
<div class="row">
<div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -54,7 +63,12 @@
</div><!-- #primary -->
<?php get_sidebar(); ?>
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div> <!-- .row -->

View File

@ -7,15 +7,19 @@
* @package understrap
*/
get_header();
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<div class="wrapper" id="author-wrapper">
<div class="container" id="content">
<div class="<?php echo $container?>" id="content">
<div class="row">
<div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -75,7 +79,12 @@
</div><!-- #primary -->
<?php get_sidebar(); ?>
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div> <!-- .row -->

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
<div class="wrapper" id="wrapper-footer">
<div class="container">
<div class="<?php echo $container?>" id="content">
<div class="row">

View File

@ -0,0 +1,13 @@
<?php
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<?php if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'left' ); ?>
<?php endif; ?>
<?php if ( 'right' === $sidebar_pos || 'left' === $sidebar_pos ): ?>
<div class="<?php if ( is_active_sidebar( 'right-sidebar' ) || is_active_sidebar( 'left-sidebar' )) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<?php elseif ( is_active_sidebar( 'right-sidebar' ) && is_active_sidebar( 'left-sidebar' ) ): ?>
<div class="<?php if ( 'both' === $sidebar_pos ) : ?>col-md-6<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<?php endif; ?>

View File

@ -7,6 +7,7 @@
* @package understrap
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
@ -32,7 +33,7 @@
<nav class="navbar navbar-dark bg-inverse site-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
<div class="container">
<div class="<?php echo $container?>" id="content">
<div class="navbar-header">

View File

@ -22,13 +22,19 @@
}
?>
<?php
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<div class="wrapper" id="wrapper-index">
<div class="container" id="content">
<div class="<?php echo $container?>" id="content">
<div class="row">
<div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -60,7 +66,12 @@
</div><!-- #primary -->
<?php get_sidebar(); ?>
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row -->

View File

@ -8,6 +8,7 @@
*/
get_header();
$container = get_theme_mod('understrap_container_type');
?>
<div class="wrapper" id="full-width-page-wrapper">

View File

@ -11,9 +11,6 @@
$container = get_theme_mod('understrap_container_type');
?>
<div class="wrapper" id="page-wrapper">
<div class="wrapper" id="page-wrapper">
<div class="<?php echo $container; ?>" id="content">

View File

@ -8,6 +8,7 @@
*/
get_header();
$container = get_theme_mod('understrap_container_type');
?>
<?php
@ -28,7 +29,7 @@
<div class="wrapper" id="full-width-page-wrapper">
<div class="container" id="content">
<div class="<?php echo $container?>" id="content">
<div class="col-md-12 content-area" id="primary">

View File

@ -23,18 +23,9 @@ $sidebar_pos = get_theme_mod('understrap_sidebar_position');
<div class="<?php echo $container?>" id="content">
<div class="row">
<?php if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'left' ); ?>
<?php endif; ?>
<?php if ( 'right' === $sidebar_pos || 'left' === $sidebar_pos ): ?>
<div class="<?php if ( is_active_sidebar( 'right-sidebar' ) || is_active_sidebar( 'left-sidebar' )) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<?php elseif ( is_active_sidebar( 'right-sidebar' ) && is_active_sidebar( 'left-sidebar' ) ): ?>
<div class="<?php if ( 'both' === $sidebar_pos ) : ?>col-md-6<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<?php endif; ?>
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -54,8 +45,12 @@ $sidebar_pos = get_theme_mod('understrap_sidebar_position');
</main><!-- #main -->
</div><!-- #primary -->
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row -->

View File

@ -7,13 +7,19 @@
get_header();
?>
<?php
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<div class="wrapper search-wrapper">
<div class="container">
<div class="<?php echo $container?>" id="content">
<div class="row">
<section class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -51,7 +57,12 @@
</section><!-- #primary -->
<?php get_sidebar(); ?>
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row -->

View File

@ -7,13 +7,20 @@
get_header();
?>
<?php
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<div class="wrapper" id="single-wrapper">
<div class="container" id="content">
<div class="<?php echo $container?>" id="content">
<div class="row">
<div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -36,7 +43,12 @@
</div><!-- #primary -->
<?php get_sidebar(); ?>
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- .row -->

View File

@ -13,11 +13,17 @@
get_header();
?>
<?php
$container = get_theme_mod('understrap_container_type');
$sidebar_pos = get_theme_mod('understrap_sidebar_position');
?>
<div class="wrapper" id="woocommerce-wrapper">
<div class="container">
<div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>col-md-8<?php else : ?>col-md-12<?php endif; ?> content-area" id="primary">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check', 'none' ); ?>
<main class="site-main" id="main" role="main">
@ -41,7 +47,12 @@
</div><!-- #primary -->
<?php get_sidebar(); ?>
<!-- Do the right sidebar check -->
<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ): ?>
<?php get_sidebar( 'right' ); ?>
<?php endif; ?>
</div><!-- Container end -->