<?php
get_header();

//Get the sidebar option
$sidebarPos = rad_get_option("sidebar-position");
$sidebar    = rad_get_meta("sidebar");

if (!is_active_sidebar($sidebar)) {
    $sidebar = "no-sidebar";
}

if ($sidebar == "no-sidebar") {

    //Added when Classic Editor is Enable/ Visual Composer is disabled
    $wpb_vc_js_status = rad_get_meta("_wpb_vc_js_status");
    if (
        !rad_is_wpbakery_frontend_editor() && 
        ($wpb_vc_js_status == "false" || $wpb_vc_js_status == "") &&
        !rad_is_elementor_active()
    ) {
        ?><div class="no-vc-container"><?php
	}

    get_template_part("templates/core/loop/loop-page");

    //Added when Classic Editor is Enable/ Visual Composer is disabled
    if (
        !rad_is_wpbakery_frontend_editor() && 
        ($wpb_vc_js_status == "false" || $wpb_vc_js_status == "") &&
        !rad_is_elementor_active()
    ) {
        ?></div><?php
	}

} else {

    $contentClass = "span9 page-has-sidebar";
    if (1 == $sidebarPos) {
        $contentClass .= " float-right";
    }

    ?>
	<div class="container">
		<div class="row">
			<div class="<?php echo esc_attr($contentClass); ?>"><?php get_template_part("templates/core/loop/loop-page");?></div>
			<?php
if (is_active_sidebar($sidebar)) {?>
				<div id="page-sidebar-wrapper" class="span3 blog-page-sidebar">
					<?php dynamic_sidebar($sidebar);?>
				</div>
			<?php }?>
		</div>
	</div>
<?php
}
get_footer();?>