<?php
$meta = get_post_meta(get_the_ID());
$sidebars = anps_parse_sidebars_from_meta($meta);

$left_sidebar = $sidebars['left_sidebar'];
$right_sidebar = $sidebars['right_sidebar'];
$num_of_sidebars = $sidebars['num_of_sidebars'];
?>
<section class="container legacy" id="site-content">
<div class="row">
    <?php if ($left_sidebar) anps_sidebar_html($left_sidebar); ?>
    <div class="col-md-<?php echo esc_attr(12 - $num_of_sidebars * 3); ?>">
        <div class="clearfix">
        <?php
            while (have_posts()) :
                the_post();
                the_content();
            endwhile;
        ?>
        </div>
        <?php
            if ((comments_open() || get_comments_number()) && get_option('anps_page_comments', '0') !== '1') {
                comments_template();
            }
        ?>
    </div>
    <?php if ($right_sidebar) anps_sidebar_html($right_sidebar); ?>
</div>
</section>
