<?php 

if(get_theme_mod('feature_area_disable') != 'on' ){ ?> 	

<div class="feature-area" id="feature" >
	<?php
      $showStatic = true;
      for( $i = 1; $i < 9; $i++ ){
      	$url = get_theme_mod('ourfeatured_page_url_'.$i, '#');
        $feature_page_id = get_theme_mod('feature_page_icon'.$i); 
        if(!empty($feature_page_id)){
          $showStatic = false;
          break;
        }
      }
  	?>
	<div class="container">  
		<div class="feature-single-area">  
			<div class="row ">	
			<?php
				$cols = get_theme_mod('feature_npp_count', 3);
				$cols++;
							// echo '$cold: '.$cols;
				switch($cols){
					case 1:
					$colCls = 'col-lg-12 col-md-12 col-sm-6 col-xs-12';
					break;
					case 2:	
					$colCls = 'col-lg-6 col-md-4 col-sm-6 col-xs-12';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					case 13:
					case 15:
					$colCls = 'col-lg-4 col-md-4 col-sm-6 col-xs-12';
					break;
					default: 
					$colCls = 'col-lg-3 col-md-3 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');
			?>
						 						
	        <?php
	          for( $i = 1; $i <= $cols; $i++ ){
	            if($showStatic === false){
	            	$url = get_theme_mod('ourfeatured_page_url_'.$i, '#');
					$feature_page_id = get_theme_mod('feature_page'.$i);
					$feature_page_title = get_theme_mod('feature_page_title'.$i, 'Decor & Styling');
					$feature_page_txt = get_theme_mod('feature_page_txt'.$i, 'Lorem Ipsum is simply dummy text of the industry.');
					$feature_btn_txt = get_theme_mod('feature_btn_txt'.$i, 'Learn More');

					$feature_title_img = get_theme_mod('feature_title_img'.$i); 
					$feature_page_icon = get_theme_mod('feature_page_icon'.$i);
					$feature_page_icon = get_theme_mod('feature_page_icon'.$i);
				if($feature_page_icon){
	              
	        ?>
		
	           <div class="<?php echo $colCls;?> f-bx">
	                <div class="fea-single ">
	                	<div class="fea-inn">
		            		<div class="fea-icon">
		            			<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
		                  			<span class="<?php echo $feature_page_icon; ?>"></span>    
		                  		</a>            		
		                	</div> 
		                	<div class="fea-conbx f-bxinn">
		                		<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
		                			<div class="fea-title inner-area-title">
		                				<?php echo $feature_page_title; ?>
		                			</div>
		                		</a>
	                			<p><?php echo $feature_page_txt; ?></p>
	                			<div class="bttn">
	                				<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
	                					<?php echo $feature_btn_txt; ?>
		                			</a>
		                		</div>
		                	</div>	
		                	<div class="clearfix"></div>		
	                	</div>                	
	            	</div>
	          	</div>
				<?php   }
				                          
				}else{?>

				<div class="<?php echo $colCls;?> f-bx">
					<div class="fea-single f-bxinn">
						<div class="fea-inn">
							<div class="fea-icon">
								<a href="#">									
									<span class="fa fa-diamond" aria-hidden="true"></span>
								</a>
							</div>
							<div class="fea-conbx">
								<a href="#">			
									<div class="fea-title inner-area-title">Decor & Styling</div>
								</a>
								<p>Lorem Ipsum is simply dummy text of the industry.</p>
								<div class="bttn">
									<a href="#">Learn More</a>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>
					
				</div>
	            <?php }
	          }?>
		       <div class="clearfix"></div>
		  	</div>
		</div>
	</div>
</div> 
  
<script type="text/javascript">
$(document).ready(function(){
    var highestBox = 0;
        $('#feature .f-bxinn').each(function(){  
                if($(this).height() > highestBox){  
                highestBox = $(this).height();  
        }
    });    
    $('#feature .f-bxinn').height(highestBox);
});
</script> 
<?php } 


