<?php   
/**
 *
 * @package Luzuk Premium
 */ 
?>
<?php $showContent = get_theme_mod('premium_slider_show_content', 'on'); ?>
<div id="ht-home-slider-section">
	<div class="shape"></div>
	<div class="shape2-right"></div>
	<div id="ht-bx-slider">


		<?php
		$args = array( 'post_type' => 'slider', 'orderby'   => 'id', 'order' => 'DESC',);
		if(!empty($pageId)){
			$args['page_id'] = absint($pageId);

		}
		$text = '';
		$query = new WP_Query($args);
		if($query->have_posts()){
			while($query->have_posts()) : $query->the_post(); 
				$pageLink = '';
				$slider_btn_link = get_post_meta($post->ID,'slider_btn_link',false);
				$sliderBtnTxt = get_post_meta($post->ID,'sliderBtnTxt',false);
				if(!empty($slider_btn_link) && is_array($slider_btn_link)){
					$pageLink = esc_url(get_permalink($slider_btn_link[0]));
				}
				if(!empty($sliderBtnTxt) && is_array($sliderBtnTxt)){
					$pageLinkTxt = $sliderBtnTxt[0];
				}else{
					$pageLinkTxt = 'Start Free Trial';
				}
				?>
				<div class="ht-slide">		
					
					<?php  if($showContent == 'on'){ ?>

						<div class="col-md-6 col-sm-6 col-xs-12 ht-slide-caption wow zoomIn">
							<?php echo '<img alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/Shape-title.png">';?>
							
							<div class="ht-slide-cap-title">
								<?php echo (get_the_title()); ?>
							</div>		
							<div class="ht-slide-cap-descmore-title">
								<?php echo (get_the_content()); ?>
							</div>
							<div class="ht-slide-cap-desc"><?php 
							if(has_excerpt()){
								echo get_the_excerpt();
							}else{
								echo lz_fitness_excerpt( get_the_content() , 110 );
							}
							?></div>			
							<?php 
							if(!empty($pageLink)){ ?>
								<div class="sliderbtn">	
									<div class="ht-slide-cap-descmore">
										<a class="btn btn-lg red" href="<?php echo $pageLink; ?>"><?php echo($pageLinkTxt); ?></a>
									</div>
								</div>
							<?php }?>
						</div><!--ht-slide-caption -->
					<?php }?>
				
					<div class="col-md-6 col-sm-6 col-xs-12 sliderimg">
						<div class="slidehexa11">
							<div class="slidehexa22">
								<div class="slidehexa33"></div>
							</div>
						</div>
							<div class="slidehexar44">
								<div class="slidehexar55"></div>
							</div>
						<div class="slidehexaimg04">
						<div class="slidehexaimg03">
						<div class="slidehexaimg02">							 	
						<div class="slidehexaimg">	
						<?php 
						if(has_post_thumbnail()){
							$total_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');	
							echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($total_slider_image[0]).'">';
						}?>
						</div>
						</div>
						</div>
						</div>
						<div class="slidehexal77"></div>	
						<div class="slidehexar66"></div>
					</div><!--sliderimg -->
				</div>
				<?php
			endwhile;
		}else{ 
			for($i=0;$i<2;$i++){?>
				<div class="ht-slide">
					<?php if($showContent == 'on'){?>

						<div class="col-md-6 col-sm-6 col-xs-6 ht-slide-caption wow zoomIn">
							<?php echo '<img alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/Shape-title.png">';?>							
							<div class="ht-slide-cap-title">BRING FRESH</div>
							<div class="ht-slide-cap-descmore-title">IDEAS</div>
							<div class="ht-slide-cap-desc">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luc tusnec ullamcorper mattis, pulvinar dapibus leo. </div>
							<div class="sliderbtn">	
								<div class="ht-slide-cap-descmore">	
									<a class="btn btn-lg red" href="<?php echo $pageLink; ?>"><?php _e( 'Get Started', 'lz-fintess-premium' ); ?></a>
								</div>
							</div>
						</div> 
					<?php }?>

					<div class="col-md-6 col-sm-6 col-xs-6 sliderimg">
						<div class="slidehexa11">
							<div class="slidehexa22">
								<div class="slidehexa33"></div>
							</div>
						</div>
							<div class="slidehexar44">
								<div class="slidehexar55"></div>
							</div>
						<div class="slidehexaimg04">
						<div class="slidehexaimg03">
						<div class="slidehexaimg02">							 	
						<div class="slidehexaimg">	
								<?php echo '<img alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/slider.jpg">';?>	 	
	
						</div>
						</div>
						</div>
						</div>
						<div class="slidehexal77"></div>	
						<div class="slidehexar66"></div>								
						<div class="clearfix"></div>						
					</div>
					<div class="clearfix"></div>
				</div>
			<?php }
		}?>
		
	</div>
	<div class="clearfix"></div>	

</div>
