<?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', 'Law Services');
			$services_subtitle = get_theme_mod('services_subtitle', 'LEGAL PRACTICE AREAS');
		?>
		<?php if( $services_title || $services_subtitle ){ ?>
		<div class="row">
					<div class="ht-section-title-tagline">
						<?php if($services_subtitle || $services_title){ ?>
						<div class="lz-featured-subheading"><?php echo !empty($services_subtitle)?$services_subtitle:''; ?></div>
						<h2 class="ht-section-title lz-featured-Post-heading">
							<?php
							if(!empty($services_title))	{
								echo ($services_title);
							} ?>
						</h2> 

						<?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:
					$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">
							
					<div class="featured-post-box wow fadeInLeft">

						<div class="featured-post">
							<a class="secondry-bg" href="#">	
								<div class="featured-icon">
									<span class="fa fa-truck"></span>
								</div>
							</a>
							<div class="featuredcontent-data">
								<a class="secondry-bg" href="#">	
									<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>
								</a>
								 <div class="featured-data">
								 	<h5 class="text">Accident Law</h5>
									    <div class="featurborder"></div>
									<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>	
								
				</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 }
