<?php
/**
 * The sidebar containing the main widget area
 */
 
global $post;

$restorator_sidebar = get_post_meta( $post->ID, 'restorator_sidebar', true );

if(is_home() || is_singular('post') || is_archive() || is_category() || is_tag() || is_search() || is_day() || is_month() || is_year()) {
	$restorator_sidebar = 'blog-sidebar';
}

if( restorator_woo_enabled() && get_post_type() == 'product' ) {
    $restorator_sidebar = 'shop-sidebar';
}
?>
	<div id="blog_sidebar" class="<?php echo esc_html( $restorator_sidebar ); ?>">
		
		<?php
			if ( is_active_sidebar( $restorator_sidebar ) ) {
				dynamic_sidebar( $restorator_sidebar );
			}
		?>
		
	</div>