<?php
global $sidebar;

$active_sidebar = is_active_sidebar( 'irk-sidebar' ) && array_key_exists( 'home', $sidebar );
?>
<?php get_header(); ?>
<?php get_template_part( 'partials/main-header' ); ?>
    <main id="main">
        <?php get_sidebar( 'top' ); ?>
        <div class="container">
            <div class="row">
                <?php $active_sidebar ? get_sidebar() : null; ?>
                <?php if ( is_active_sidebar( 'irk-mainbar' ) ): ?>
                    <div class="mainbar col-12 <?php echo $active_sidebar ? 'col-lg-9' : null; ?>">
                        <?php dynamic_sidebar( 'irk-mainbar' ); ?>
                    </div>
                <?php endif; ?>
            </div>
            <?php get_template_part( 'partials/bottom-bar' ); ?>
        </div>
    </main>
<?php
get_template_part( 'partials/main-footer' );
get_footer();