<?php
/**
 * Left sidebar check
 *
 * @package Wrock Metro
 */

// 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_wrockmetro', 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_cart() || is_checkout() || is_account_page()){
                echo '<div class="col-md-12" content-area" id="primary">';
            }else {
                $sidebar_pos = get_theme_mod( 'wrockmetro_sidebar_position' );
            if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) {
                get_template_part( 'sidebar-templates/sidebar', 'left' );
            }
            $colmd = wrockmetro_single_colmd(); ?>
            <div class="col-md-<?php echo $colmd; ?> content-area" id="primary"> 
            <?php
            }
        }else{
            $sidebar_pos = get_theme_mod( 'wrockmetro_sidebar_position' );
            if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) {
                get_template_part( 'sidebar-templates/sidebar', 'left' );
            }
            $colmd = wrockmetro_single_colmd(); ?>
            <div class="col-md-<?php echo $colmd; ?> content-area" id="primary"> 
            <?php
        }
//    }
