diff options
Diffstat (limited to 'global-templates')
| -rw-r--r-- | global-templates/hero.php | 25 | ||||
| -rw-r--r-- | global-templates/left-sidebar-check.php | 44 | ||||
| -rw-r--r-- | global-templates/right-sidebar-check.php | 21 |
3 files changed, 90 insertions, 0 deletions
diff --git a/global-templates/hero.php b/global-templates/hero.php new file mode 100644 index 0000000..fb02503 --- /dev/null +++ b/global-templates/hero.php @@ -0,0 +1,25 @@ +<?php +/** + * Hero setup. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<?php if ( is_active_sidebar( 'hero' ) || is_active_sidebar( 'statichero' ) || is_active_sidebar( 'herocanvas' ) ) : ?> + + <div class="wrapper" id="wrapper-hero"> + + <?php get_template_part( 'sidebar-templates/sidebar', 'hero' ); ?> + + <?php get_template_part( 'sidebar-templates/sidebar', 'herocanvas' ); ?> + + <?php get_template_part( 'sidebar-templates/sidebar', 'statichero' ); ?> + + </div> + +<?php endif; ?> diff --git a/global-templates/left-sidebar-check.php b/global-templates/left-sidebar-check.php new file mode 100644 index 0000000..1380da4 --- /dev/null +++ b/global-templates/left-sidebar-check.php @@ -0,0 +1,44 @@ +<?php +/** + * Left sidebar check. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<?php +$sidebar_pos = get_theme_mod( 'understrap_sidebar_position' ); +?> + +<?php if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) : ?> + <?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 ) ) { + # modified 2018-10-10 + $html .= 'col-lg-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">'; + } diff --git a/global-templates/right-sidebar-check.php b/global-templates/right-sidebar-check.php new file mode 100644 index 0000000..e32e375 --- /dev/null +++ b/global-templates/right-sidebar-check.php @@ -0,0 +1,21 @@ +<?php +/** + * Right sidebar check. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +</div><!-- #closing the primary container from /global-templates/left-sidebar-check.php --> + +<?php $sidebar_pos = get_theme_mod( 'understrap_sidebar_position' ); ?> + +<?php if ( 'right' === $sidebar_pos || 'both' === $sidebar_pos ) : ?> + + <?php get_template_part( 'sidebar-templates/sidebar', 'right' ); ?> + +<?php endif; ?> |
