<?php

/**
 * @package dance-studio-lite
 */
get_header();

$dance_studio_lite_custom_sidebar_page_layout = get_theme_mod('dance_studio_lite_custom_sidebar_page_layout', 'singleleft');
$dance_studio_lite_custom_sidebar_homepage_layout = get_theme_mod('dance_studio_lite_custom_sidebar_homepage_layout');

$csscovers = 'col-md-8 col-lg-8 col-sm-12';
?>
<style>
<?php

    if(($dance_studio_lite_custom_sidebar_page_layout == 'singleright' && !is_front_page()) ||      ($dance_studio_lite_custom_sidebar_homepage_layout == 'singleright' && is_front_page())){
        echo '#sidebar { float:right !important; }'; 
    }
?>
</style>

<?php 
    if(($dance_studio_lite_custom_sidebar_page_layout == 'sitefull' && !is_front_page()) || ($dance_studio_lite_custom_sidebar_homepage_layout == 'sitefull' && is_front_page())){
        $csscovers = "col-md-12 col-lg-12 col-sm-12";
    }
?>


<div class="container" id="contentdiv">
    <?php 
        if(($dance_studio_lite_custom_sidebar_page_layout != 'nosidebar' && $dance_studio_lite_custom_sidebar_page_layout != 'sitefull' && !is_front_page()) || ($dance_studio_lite_custom_sidebar_homepage_layout != 'nosidebar' && $dance_studio_lite_custom_sidebar_homepage_layout != 'sitefull' && is_front_page())){
        ?>
        <div class="col-md-4 col-lg-4 col-sm-12" id="sidebar">
                <?php get_sidebar(); ?>
            </div><!--col-md-4-->
        <?php
        } 
    ?>
    

    <div class="site-main <?php echo esc_attr($csscovers); ?>">
        <div class="blog-post">
            <?php
            if (have_posts()) :

                while (have_posts()) : the_post();
            ?>
                    <?php if (has_post_thumbnail()) { ?>
                        <div class="post-thumb">
                            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
                        </div>
                    <?php } ?>
                    <div class="clear"></div>
                    <div class="heading">
                        <?php if (is_front_page()) { ?>
                            <h3 class="style2"><?php the_title(); ?></h3>
                        <?php } else { ?>
                            <h1><?php the_title(); ?></h1>
                        <?php } ?>
                    </div>
                    <div class="pagecontent"><?php the_content(); ?></div>
                    <?php if (is_singular()) wp_enqueue_script("comment-reply"); ?>
                    <?php if (!is_front_page()) { ?>
                        <?php
                        if (comments_open() || get_comments_number()) :
                            comments_template();
                        endif;
                        ?>
                    <?php } ?>
            <?php
                endwhile;
            endif;
            ?>
        </div><!--blog-post -->
    </div><!--col-md-8-->
    <div class="clearfix"></div>

</div><!-- container -->
<?php get_footer();
