<?php
/**
 * The sidebar containing the main widget area
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package giornalismo
 */

namespace JM_Web_Development\Giornalismo;

if ( ! giornalismo()->is_left_sidebar_active() && ! giornalismo()->is_right_sidebar_active() ) {
	return;
}

giornalismo()->print_styles( 'giornalismo-sidebar', 'giornalismo-widgets' );

if ( 'two-sidebars' === get_theme_mod( 'giornalismo-layout' ) || 'left-sidebar' === get_theme_mod( 'giornalismo-layout' ) ) {
	?>
	<aside id="left-sidebar" class="primary-sidebar widget-area">
		<h2 class="screen-reader-text"><?php esc_attr_e( 'Left Asides', 'giornalismo' ); ?></h2>
		<?php giornalismo()->display_left_sidebar(); ?>
	</aside><!-- #secondary -->
	<?php
}

if ( 'two-sidebars' === get_theme_mod( 'giornalismo-layout' ) || 'right-sidebar' === get_theme_mod( 'giornalismo-layout' ) ) {
	?>
	<aside id="right-sidebar" class="primary-sidebar widget-area">
		<h2 class="screen-reader-text"><?php esc_attr_e( 'Right Asides', 'giornalismo' ); ?></h2>
		<?php giornalismo()->display_right_sidebar(); ?>
	</aside><!-- #secondary -->
	<?php
}

