<?php
/**
 *
 * @package LZ Premium
 */
if(get_theme_mod('lz_fitness_featured_section_disable') != 'on' ){?>
 
	<section id="featured-post-section" class="ht-section">	
			<?php
			$showStatic = true;
			for( $i = 1; $i < 4; $i++ ){
					$url = get_theme_mod('lz_fitness_feature_page_url_'.$i, '#');
				$link = get_theme_mod('lz_fitness_feature_page_link'.$i);
				$lz_fitness_featured_page_id = get_theme_mod('lz_fitness_feature_page_icon'.$i); 
				if(!empty($lz_fitness_featured_page_id)){
					$showStatic = false;
					break;
				}
			}
			?>
			<div class="clearfix"></div>
			<div class="row row-eq-height">
			<div class="col-md-6 featureleftbox padding0">	
 			<div class="inside-full-height">

			<div class="feature-post-wrap">
					<?php
					$cols = get_theme_mod('lz_fitness_featured_npp_count', 3);
					$cols++;
			// echo '$cold: '.$cols;
					switch($cols){
						case 1:
							$colCls = 'col-md-12 col-sm-12 col-xs-12';
							break;
						case 2:
							$colCls = 'col-md-6 col-sm-6 col-xs-12';
							break;
						case 3:
						case 5:
						case 6:
						case 9:
							$colCls = 'col-md-6 col-sm-6 col-xs-12';
							break;
						default:
							$colCls = 'col-md-6 col-sm-6 col-xs-12';
							break;
					}
					$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
					?>
					<div class="row">
						<?php
						for( $i = 1; $i <= $cols; $i++ ){
							if($showStatic === false){
								$url = get_theme_mod('lz_fitness_feature_page_url_'.$i, '#');
								$lz_fitness_feature_page_title = get_theme_mod('lz_fitness_feature_page_title_'.$i, 'Experience Chefs');
								$lz_fitness_feature_page_description = get_theme_mod('lz_fitness_feature_page_description_'.$i, 'There are many variations passages Lorem Ipsum available, but majority have suffered alteration in some form.');
								$lz_fitness_featured_page_id = get_theme_mod('lz_fitness_featured_page'.$i);
								$lz_fitness_feature_page_icon = get_theme_mod('lz_fitness_feature_page_icon'.$i);
								if($lz_fitness_feature_page_icon){

									?>

									<div class="<?php echo $colCls;?> fpost">
										<div class="featured-post-box">

										<div class="featured-post">
										
												<a class="secondry-bg" target="_blank" href="<?php echo esc_url(!empty($url)?$url:'#');?>">	
												<div class="featured-icon">
													<span class="<?php echo $lz_fitness_feature_page_icon; ?>"></span>
												</div>
											</a>
											<div class="featuredcontent-data">
												 <div class="featured-data">
												 	<a class="secondry-bg" target="_blank" href="<?php echo esc_url(!empty($url)?$url:'#');?>">	
													 	<h5><?php echo $lz_fitness_feature_page_title; ?>
													</h5>
												</a>
												 	<div class="featuredborder"></div>
													<div class="clearfix"></div>
													<p><?php echo $lz_fitness_feature_page_description; ?></p>
												</div>
											</div>
										</div>
										<div class="clearfix"></div>
									</div>


									</div>
									
									<?php
								}	
							}else{?>
								<div class="<?php echo $colCls;?> fpost">
									<div class="featured-post-box">

										<div class="featured-post">
											<a class="secondry-bg" href="#" target="_blank">	
												<div class="featured-icon">
													<span class="fa fa-birthday-cake"></span>
												</div>
											</a>
											<div class="featuredcontent-data">
												 <div class="featured-data">
												 	<a class="secondry-bg" href="#" target="_blank">	
												 		<h5>Experience Chefs</h5>
												 	</a>
												 	<div class="featuredborder"></div>
													<div class="clearfix"></div>
													<p>There are many variations passages Lorem Ipsum available, but majority have suffered alteration in some form.</p>
												</div>
											</div>
										</div>
										<div class="clearfix"></div>
									</div>

								</div>
							<?php }

						}?>
						<div class="clearfix"></div>
					</div>
				</div>
			</div>
		</div>
		<div class="col-md-6 services-img-box padding0">	
				<div class="inside-full-height services-img">
					<?php 
					$lz_fitness_feature_image = get_theme_mod('lz_fitness_feature_image');
					if(!empty($lz_fitness_feature_image)){
						echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($lz_fitness_feature_image).'" class="img-responsive" />';
					}else{
						echo '<img alt="Services" src="'.get_template_directory_uri().'/images/servicesimg.jpg" class="img-responsive" />';
					}
						?>
				</div>
			</div>		


	</div>
		<div class="clearfix"></div>
	</section>
<script>
  jQuery.noConflict();
  $(function(){
    function featuredpostboxHeight(){
      var ht = 0;
      $('#featured-post-section .featured-post-box').each(function(i){
        var tHt = $(this).height();
        if(ht<tHt){
          ht=tHt;
        }
      });
      $('#featured-post-section .featured-post-box').height(ht+'px');
    }
    featuredpostboxHeight();
  });
  $( window ).resize(function(){
    featuredpostboxHeight();
  });
</script>
<?php }