<?php  
/**
 *
 * @package LZ Fitness Premium
 */

if(get_theme_mod('services_section_disable') != 'on' ){ ?>
<section id="services-post-section" class="ht-section">
	<div class="lightbox">
		<?php
		// echo "post id: ". 
		$services_page_id = get_theme_mod('services_page');	
		  // echo '<br>title '.		
		$services_title = get_theme_mod('services_title', 'Our Services');
		$services_sub_title = get_theme_mod('services_sub_title', 'Lorem Ipsum availables, but majority have suffered.');
		$homepageservicesbutton = get_theme_mod('homepageservices_buttxt', 'Read More');
		?>
		<div class="container">
		<?php if( $services_title || $services_sub_title ){ ?>
		<div class="row">
					<div class="ht-section-title-tagline">
						<h2 class="ht-section-title lz-services-Post-heading">
							<?php
							if(!empty($services_title))	{
								echo ($services_title);
							} ?>
						</h2> 
						<div class="clearfix"></div>
						<div class="col-md-6 col-md-offset-3 lz-services-subheading">
							<?php 
							if(!empty($services_sub_title))	{
								echo ($services_sub_title);
							} ?>
						</div>
						<div class="clearfix"></div> 
					</div>
					<div class="clearfix"></div>
				</div>
		<?php } ?>
		<div class="clearfix"></div>
	</div>
	<div class="container"> 
	<!-- <div class="ht-team-member-wrap ht-clearfix"> -->
		<?php 
		$showStatic = true;
		$cols = get_theme_mod('services_npp_count', 7);
		$cols++;
		switch($cols){
			case 1:
                $colCls = 'col-md-12 col-sm-12';
                break;
            case 2:
            case 3:
            case 4: 
            case 5:
            case 6: 
            case 7: 
            case 8: 
            case 9:
            case 10:
            case 11:
            case 12: 
            case 13: 
            case 14: 
            case 15:
            case 16: 
              
                $colCls = 'col-md-3 col-sm-6';
                break;
            
            default: 
                $colCls = 'col-md-4 col-sm-6';
                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);
			if($services_page_id){
				$showStatic = false;
				echo featuredShortCode($services_page_id, $isCustomizer=true, $i);
				$homepageservicesbutton = get_theme_mod('homepageservices_buttxt', 'Read More');
			}
		}
		// adding the static content
		if($showStatic === true){
			for( $i = 1; $i <= $cols; $i++ ){ ?>
			<div class="<?php echo $colCls;?> padding5">
				<div class="services-post">
					 <a href="<?php the_permalink(); ?>">
					<div class="service_img">
						<img class="secondry-bg img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/service.jpg');?>" alt="img" />
					</div>
				</a>
					<div class="services-data">
					
				 		<h3 class="post-title"> <a href="<?php the_permalink(); ?>">Metal Roofing</a></h3>
				 	
				 		<p class="description">There are many variations passages of Lorem Ipsum availables, but majority have suffered alteration in some form injected humour.</p>

				 		<?php
							$homepageservicesbutton = get_theme_mod('homepageservices_buttxt', 'Read More'); 
							?>
				 	
				 	<?php if( get_theme_mod('servicesall_button_display','show' ) == 'show') :
							?>
				 	<!--<div class="servicess-button">
				 		<button><a href="#"> Read More<i class="fa fa-arrow-right"></i></a></button>
				 	</div>-->
				 	<button><a href="<?php echo esc_url(get_permalink()); ?>"><?php echo ($homepageservicesbutton );  ?><i class="fa fa-arrow-right"></i> </a></button>
				 	<?php endif ?> 
				 </div>
				</div>		
					<div class="clearfix"></div>			 
			</div>
			<?php 
			}
		} ?>
		<div class="clearfix"></div>
		
	</div>	
	<div class="clearfix"></div>
</div>
</section>
<script>
	jQuery.noConflict();
	$(function(){
		function servicespostHeight(){
			var ht = 0;
			$('#services-post-section .services-post').each(function(i){
				var tHt = $(this).height();
				if(ht<tHt){
					ht=tHt;
				}
			});
			$('#services-post-section .services-post').height(ht+'px');
		}
		servicespostHeight();
	});
	$( window ).resize(function(){
		servicespostHeight();
	});
</script>


<?php }

