<?php
/**
 *
 * @package LZ Fitness Premium
 */
if(get_theme_mod('services_section_disable') != 'on' ){ ?>
<section id="featured-post-section" class="ht-section">
	<div class="container">

		<?php	
				// echo "post id: ". 
			$services_page_id = get_theme_mod('services_page');			
			$services_title = get_theme_mod('services_title', 'Our <strong>Services</strong>');
		?>
		<?php if( $services_title){ ?>
		<div class="row">
			<div class="ht-section-title-tagline">
				<?php if($services_title){ ?>
				<h2 class="ht-section-title lz-featured-Post-heading">
					<?php
					if(!empty($services_title))	{
						echo ($services_title);
					} ?>
				</h2> 
				<div class="titleborder"></div>
				<?php } ?> 
			</div>
				<div class="clearfix"></div>
			</div>
		<?php } ?>
		<div class="row">		
	 
			<?php 
			$showStatic = true;
			$cols = get_theme_mod('services_npp_count', 5);
			$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:
				case 10:
				case 11:
					$colCls = 'col-md-4 col-sm-6 col-xs-12';
					break;
				default:
					$colCls = 'col-md-3 col-sm-6 col-xs-12';
					break;
			}
			for( $i = 1; $i <= $cols; $i++ ){
				$services_page_id = get_theme_mod('services_page'.$i); 
				$services_page_icon = get_theme_mod('services_page_icon'.$i);
				$services_page_icon1 = get_theme_mod('services_page_icon1'.$i);
				if($services_page_id){
					$showStatic = false;
					echo featuredShortCode($services_page_id, $isCustomizer=true, $i);
				}
			}
			// adding the static content
			if($showStatic === true){
				for( $i = 1; $i <= $cols; $i++ ){ ?>
				<div class="<?php echo $colCls;?> fpost">
							<a href="">	
					<div class="featured-post-box wow fadeInLeft">

						<div class="featured-post">
							
								<div class="featured-icon">
									<span class="fa fa-home"></span>
								</div>
							
							<div class="featuredcontent-data">
								
									<div class="featured-img">
								 	<img class="secondry-bg img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/feature.jpg');?>" alt="feature" /></div>
								
								 <div class="featured-data">
								 	<h5 class="text">Domestic Cleaning</h5>
									<div class="clearfix"></div>
									<p>There are many variations passages Lorem Ipsum available, but majority have suffered alteration in some form, by injected humour.</p>
								</div>
							</div>
						</div>
						<div class="clearfix"></div>
					</div>	
						</a>		
				</div>
				<?php 
				}
			} ?>
		</div>
		<div class="clearfix"></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 }
