<div class="container">
	<div class="row">
		<div class="col-md-12">
			<div class="header-slider">
<?php
		$slider_cat = nysu_magazine_data('magazine_slider_cat',array(0));
		$query_args = array();
		$query_args['cat'] = implode( ', ',$slider_cat);
		$query_args['ignore_sticky_posts'] = 1;
		$query_args['posts_per_page'] = nysu_magazine_data('magazine_slider_post_count',6);
		$query_args['meta_query'] = array(array('key' => '_thumbnail_id'));
		$widget_posts = new WP_Query($query_args);
      
			if ($widget_posts->have_posts()) :
		
				$last = $widget_posts->post_count;
				echo '<div class="nyma-normal-widget">' . "\n";				
				echo '<div class="owl-carousel nyma-slider-2">' . "\n";
					$i = 0;
					
					while ($widget_posts->have_posts()) : $widget_posts->the_post();
						$i++;
						if (($i%3)==1) { 
							echo '<div class="nyma-stack-1">';
							get_template_part( 'template-parts/block/stack', '1-1' );
						
						} else {
							if (($i%3)==2) { 
								echo '<div class="nyma-stack-right">';
								get_template_part( 'template-parts/block/stack', '1-2' );
								
							} else 
							if (($i%3)==0) {
								get_template_part( 'template-parts/block/stack', '1-2');
								echo '</div>';
								echo '<div class="clearfix"></div>';
								echo '</div>';
							}
						}
					endwhile;
					if (($i%3)==2) { 
						get_template_part( 'template-parts/block/stack', '1-2-2');
					}
					if (($i%3)==1) { 
						get_template_part( 'template-parts/block/stack', '1-2-1');
					}
					wp_reset_postdata();
				echo '</div>' . "\n";
				echo '</div>' . "\n";
			endif;
	

?>
			</div>
		</div>
	</div>
</div>