<?php if(get_theme_mod('tromas_slider_enable')) : ?>
<!-- Start Slider Area -->
<section class="hero-area">
	<div class="slider-one">
		<?php $k=1; 
		for($i=1;$i<11;$i++){
				$slider_page[$k]=get_theme_mod('tromas_slider_page_'.$i);
				$slider_button_1_title[$k]=get_theme_mod('tromas_slider_button_title_'.$i);
				$slider_button_1_url[$k]=get_theme_mod('tromas_slider_button_url_'.$i);
				$slider_text_position[$k]=get_theme_mod('tromas_slider_text_position'.$i);
				$k=$k+1;
		}

		$args = array (
           			'post_type' => 'page',
                  	'post_per_page' => $k,
                  	'posts_per_page'=>10,
                  	'post__in'         => ($slider_page) ? ($slider_page) : '',
                  	'orderby'           =>'post__in',
                );

		$sliderloop = new WP_Query($args);
		$j=1;

  		if ($sliderloop->have_posts()) :  while ($sliderloop->have_posts()) : $sliderloop->the_post();?>
			<?php if(has_post_thumbnail()): ?>
			<?php $slider_img_url = get_the_post_thumbnail_url(get_the_ID($i),'tromas_slider_thumb'); ?>
		<!-- Single Slider --> 
		<div class="single-slider" style="background-image:url('<?php echo esc_url($slider_img_url); ?>')">
			<?php else: ?>
		<div class="single-slider" style="background-image:url('<?php echo esc_url(get_template_directory_uri());?>/assets/images/slider2.jpg');">
			<?php endif; ?>
			<div class="container">
				<div class="row">
					 <?php
			                if( $slider_text_position[$j] == 'right') :
			                $class = 'col-lg-7 offset-lg-5 col-12';
			            	endif;
			            
			                if( $slider_text_position[$j] == 'left' ) :
			                   	$class = 'col-lg-7 col-12';
			                endif;
			            ?>
					<div class="<?php echo esc_attr($class); ?>">
						<!-- Slider Text -->
						<div class="slide-text <?php echo esc_attr($slider_text_position[$j]); ?>">
							<h1><span class="short"><?php the_title(); ?></h1>
							<p><?php the_excerpt(); ?></p>
							
						
	   							<div class="slide-btn">	
	   							<?php if($slider_button_1_title[$j]): ?>
									<?php
									if (($slider_button_1_url[$j])):?>
										<a href="<?php echo esc_url($slider_button_1_url[$j]); ?>" class="btn primary video-play video-popup mfp-fade"><?php echo esc_attr($slider_button_1_title[$j]); ?><i class="fa fa-play"></i>
											<div class="waves-block">
												<div class="waves wave-1"></div>
												<div class="waves wave-2"></div>
												<div class="waves wave-3"></div>
											</div>
										</a>
									<?php else:?>
											<a href="<?php echo esc_url($slider_button_1_url[$j]); ?>" class="btn primary"><?php echo esc_attr($slider_button_1_title[$j]); ?><i class="fa fa-long-arrow-down"></i></a>
									<?php endif; ?>
								<?php endif;?>
								</div>
						</div>
						<!--/ End SLider Text -->
					</div>
				</div>
			</div>
		</div>
		<!--/ End Single Slider -->
		<?php $j=$j+1; endwhile;
      	wp_reset_postdata();  
        endif; ?>
	</div>
</section>
<!--/ End Slider Area -->
<?php endif;?>