<?php
/**
 *
 * @package theme-eye-Premium
 */
if(get_theme_mod('lz_fitness_featured_section_disable') != 'on' ){
	?>
 
<section id="featured-post-section" class="ht-section">
	<div class="lightbox">
		<div class="col-md-10 col-md-offset-1">
			<div class="wow fadeInUp" data-wow-duration="1s">
				<?php
				$showStatic = true;
				for( $i = 1; $i < 3; $i++ ){
					$lz_fitness_featured_page_id = get_theme_mod('lz_fitness_featured_page_icon'.$i); 
					if(!empty($lz_fitness_featured_page_id)){
						$showStatic = false;
						break;
					}
				}
				$lz_fitness_featured_title = get_theme_mod('lz_fitness_featured_title', 'OUR FEATURES'); 
				//extra//
                $countword=str_word_count($lz_fitness_featured_title);
        // echo ' hLF '.
                // $halfWd = floor($countword / 2);
                // $wds = explode(' ',$lz_fitness_featured_title);
                // $lz_fitness_featured_title_new = '';
                // foreach($wds as $k=>$wd){
                //     if($k == $halfWd){
                //         $lz_fitness_featured_title_new .= '<span>';
                //     }
                //     $lz_fitness_featured_title_new .= $wd.' ';
                //     if(($k+1) == $countword){
                //         $lz_fitness_featured_title_new .= '</span>';
                //     }
                // }
        // extra//
				$lz_fitness_featured_sub_title = get_theme_mod('lz_fitness_featured_sub_title', 'There are many variations passes Lorem Ipsum available but the majority have suffered alteation some form.');
				?>
				<div class="row">
					<div class="ht-section-title-tagline">
						<h2 class="ht-section-title lz-featured-heading">
							<?php 
							 if(!empty($lz_fitness_featured_title))	{
								 echo ($lz_fitness_featured_title);
							} ?>
						</h2>
						<div class="clearfix"></div>
						<div class="col-md-6 col-md-offset-3 lz-featured-subheading">
						<?php 
							 if(!empty($lz_fitness_featured_sub_title))	{
								 echo ($lz_fitness_featured_sub_title);
							} ?>
					</div>
					<div class="clearfix"></div>
					</div>
					
					<div class="clearfix"></div>
				</div>				
				<div class="featured-post-wrap">
					<?php
					$cols = get_theme_mod('lz_fitness_featured_npp_count', 2);
					$cols++;
					// echo '$cold: '.$cols;
					switch($cols){
					case 1:
					$colCls = 'col-md-12 col-sm-12';
					break;
					case 2:
					$colCls = 'col-md-6 col-sm-6';
					break;
 
					case 4:
					$colCls = 'col-md-3 col-sm-6';
					break;

					default: 
					$colCls = 'col-md-4 col-sm-6';
					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){
					$lz_fitness_featured_page_title = get_theme_mod('lz_fitness_featured_page_title_'.$i, 'Inside Our Studio');
					$lz_fitness_featured_page_desc = get_theme_mod('lz_fitness_featured_page_desc_'.$i, 'There are many vartins passes Lorem Ipsum available but the majority have suffered alteation some form, injected humour, or randosed words which look even slightly believable.');
					$lz_fitness_featured_page_id = get_theme_mod('lz_fitness_featured_page'.$i);
					$lz_fitness_featured_page_icon = get_theme_mod('lz_fitness_featured_page_icon'.$i);
					if($lz_fitness_featured_page_icon){
					
							?>
							<div class="<?php echo $colCls;?> featured-space">	
								<div class="featured-post inside-full-height text-center">			
									<!-- <div class="support-icon">
										<img src="<?php //echo esc_url($theme_eye_support_page_icon); ?>" class="img-responcive" />
									</div> -->
									<div class="featured-icon">
										<span class="<?php echo $lz_fitness_featured_page_icon; ?>"></span>
									</div>
									<h5><?php echo $lz_fitness_featured_page_title; ?></h5>
									<p><?php echo $lz_fitness_featured_page_desc; ?></p>														
									<div class="clearfix"></div>
								</div>
							</div>
							<?php
					}	
					}else{?>
					<div class="<?php echo $colCls;?> featured-space">
					<div class="featured-post inside-full-height text-center">											
						<!-- <div class="support-icon">
							<img src="<?php //echo esc_html(get_template_directory_uri()); ?>/images/default01.png" class="img-responcive" />
						</div> -->
						<div class="featured-icon"><span class="fa fa-home"></span></div>						
						<h5>Inside Our Studio</h5>		
						<p>There are many vartins passes Lorem Ipsum available but the majority have suffered alteation some form, injected humour, or randosed words which look even slightly believable.</p>									
						<div class="clearfix"></div>	 	
					</div>
					</div>
					<?php }

					}?>
					<div class="clearfix"></div>
					</div>
				</div>
			</div>
		</div>
		<div class="clearfix"></div>
	</div>
</section>

<?php }