<?php
/**
 * The template for displaying the full width grid section.
 *
 * @package WordPress
 * @subpackage Edition
 * @since Edition 1.0
 */
global 
$tw_order_class, // section order 
$tw_section, // section object
$type; // section type

$tw_section = themewich_section_object(); // section post options

// Set post classes
$tw_section->post_classes  = array(
	'content-section',
	'content-sidebar',
	'section',
	$tw_order_class,
	$tw_section->title_class
); ?>

<div <?php post_class($tw_section->post_classes); ?>>
	<?php themewich_section_edit(); // Edit link ?>

	<div class="container">
		<div class="col-md-12">
			<?php get_template_part( TW_SECTIONS_DIR .'/section-title'); // Section title  ?>
		</div>
  
		<div class="rightside">
			<div class="rightcontent">
				<?php echo wp_kses_post( $tw_section->section_content ); ?>
			</div>
		</div>

		<div class="sidebar">
			<div class="sidebarcontent">
				<?php
				// Get correct post ID 
					//$post_id    = $section_post->ID; 
					if ( ! acf_Widget::dynamic_widgets( 'Content Section Sidebar', $post->ID ) ) {
						dynamic_sidebar( 'Grid Sidebar' ); //fallback to default sidebar if nothing is set
					} 
				?>
			</div>
		</div>
	</div>

	<div class="clear"></div>
</div>