HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //old_home_backup/bmw7resource.co.uk/public_html/wp-content/themes/kingcabs/sidebar.php
<?php
/**
 * The sidebar containing the main widget area
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package King_Cabs
 */
$post_sidebar = "nosidebar";
if( $post )
	$post_sidebar = esc_attr( get_post_meta($post->ID, 'kingcabs_page_layouts', true) );

	if( empty($post_sidebar) ) {
		$post_sidebar = 'rightsidebar';
	}

	if ( $post_sidebar ==  'nosidebar' ) {
		return;
	}
	
if( $post_sidebar == 'rightsidebar' && is_active_sidebar('sidebar-1')){ ?>
	<div class="col-md-3 col-sm-4 widget-area">
		<?php dynamic_sidebar( 'sidebar-1' ); ?>
	</div>
	<?php
}

if( $post_sidebar == 'leftsidebar' && is_active_sidebar('sidebar-2')){ ?>
	<div class="col-md-3 col-sm-4 widget-area">
		<?php dynamic_sidebar( 'sidebar-2' ); ?>
	</div>
	<?php
}