<?php
/**
 * Left sidebar check
 *
 * @package Digital
 */

// 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_digital', 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{
        $sidebar_pos = get_theme_mod( 'digital_sidebar_position' );
        $colmd = digital_single_colmd(); 

        if ((class_exists('woocommerce')) && (is_woocommerce() || is_cart() || is_checkout() )) {
                if ( 'left' === $sidebar_pos || 'both' === $sidebar_pos ) {
                                get_template_part( 'sidebar-templates/sidebar', 'left' );
                echo '<div class="col-md-'.$colmd.' content-area" id="primary">';
                }
            }else{
            if ( 'left' === $sidebar_pos) {
                get_template_part( 'sidebar-templates/sidebar', 'left' );
                echo '<div class="col-md-8 content-area" id="primary">';
            }elseif ('both' === $sidebar_pos ){
                get_template_part( 'sidebar-templates/sidebar', 'left' );
                echo '<div class="col-md-6 content-area" id="primary">';
            }elseif('right' === $sidebar_pos){
                echo '<div class="col-md-8 content-area" id="primary">';
            }else{
                echo '<div class="col-md-12 content-area" id="primary">';
            }
        }




