<?php
/**
 * Left sidebar check
 *
 * @package Magazine Style
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
// Ensure we're within the loop
// global $wp_query;
// $postid = $wp_query->post->ID;

// $postid = get_the_ID();
// $postID = get_queried_object_id();
//$layoutmeta = get_post_meta(get_the_ID(), '_singlepost_magazinestyle', true);
//echo "Layout Meta Valuess: " . $layoutmeta;

// if ('ls' == $layoutmeta || 'lr' == $layoutmeta) {
//     get_template_part( 'global-templates/left-sidebar-check' );
//  }elseif ('fc' == $layoutmeta || 'rsd' == $layoutmeta){

//  }else{
        if (class_exists('woocommerce')) {	
            if (! is_woocommerce() && ! is_cart() && ! is_checkout() ){
                echo '<div class="col-md-12 content-area" id="primary">';
            }else {
                $sidebar_pos = get_theme_mod( 'magazinestyle_sidebar_position' );
            if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) {
                get_template_part( 'sidebar-templates/sidebar', 'left' );
            }
            $colmd = magazinestyle_single_colmd(); ?>
            <div class="col-md-<?php echo $colmd; ?> content-area" id="primary"> 
            <?php
            }
        }else{
            $sidebar_pos = get_theme_mod( 'magazinestyle_sidebar_position' );
            if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) {
                get_template_part( 'sidebar-templates/sidebar', 'left' );
            }
            $colmd = magazinestyle_single_colmd(); ?>
            <div class="col-md-<?php echo $colmd; ?> content-area" id="primary"> 
            <?php
        }
//    }
