<?php   
if(get_theme_mod('gallery_section_disable') != 'on' ){ ?>  
	<?php 
		if( get_theme_mod('secgalleryTpadding',true) ) {
			$secgalleryTpadding = 'padding-top:'.esc_attr(get_theme_mod('secgalleryTpadding')).';';
		}
		if( get_theme_mod('secgalleryBpadding',true) ) {
			$secgalleryBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('secgalleryBpadding')).';';
		}
	?>		

<section id="gallery" class="gallery-area" style="<?php echo esc_attr($secgalleryTpadding); ?>" "<?php echo esc_attr($secgalleryBpadding); ?>">
	<?php
		$gallery_page_id = get_theme_mod('gallery_page');	
		$gallery_maintitle = get_theme_mod('gallery_maintitle', 'FIND US ON INSTAGRAM');
		$gall_caption = get_theme_mod('gall_caption', '@Winewhisperer');
		$gall_link = get_theme_mod('gall_link', '#');
	?>
	<div class="gall-bx">
		<div class="gallery-main-box">
			<?php 
				if($gallery_maintitle || $gall_caption){
			?>
				<div class="gall-contain wow zoomIn">
					<div class="gallery-box">
						<a href="<?php echo ($gall_link);  ?>">
							<i class="fa fa-instagram" aria-hidden="true"></i>
							<div class="gallery-title">
								<?php echo ($gallery_maintitle);  ?>
							</div>
							<p><?php echo ($gall_caption);  ?></p>
						</a>
					</div>
				</div>
			<?php } ?>
		    <?php 
				$showStatic = true;
				$cols = get_theme_mod('gallery_npp_count', 6);
				$cols++;
				switch($cols){
					case 1:
					$colCls = 'col-lg-12 col-md-12 col-sm-12';
					break;
					case 2:	
					$colCls = 'col-lg-6 col-md-6 col-sm-6';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					case 13:
					case 15:
					$colCls = 'col-lg-4 col-md-6 col-sm-6';
					break;
					default: 
					$colCls = 'col-lg-4 col-md-6 col-sm-6';
					break;
				}
				for( $i = 1; $i <= $cols; $i++ ){
					$gallery_page_id = get_theme_mod('gallery_page'.$i); 
					$gallery_page_icon = get_theme_mod('gallery_page_icon'.$i);
					if($gallery_page_id){
						$showStatic = false;
						echo galleryShortCode($gallery_page_id, $isCustomizer=true, $i);
					}
				}
				if($showStatic === true){
 					for( $i = 1; $i <= $cols; $i++ ){
				?>		
				 <div class="gall-contain wow zoomIn">
					<div class="homegalry ">
						<div class="lz-gallery-images ">
							<figure class="spa-gall">
								<a data-fancybox="gallery" href="<?php echo esc_url(get_template_directory_uri().'/images/abotimg1.jpg');?>" title="Gallery 1"> 
									<img src="<?php echo esc_url(get_template_directory_uri().'/images/abotimg1.jpg');?>" alt="Gallery" />
									<div class="gall-imgovly"></div>
									<div class="over-text">
										<i class="fa fa-plus-square-o" aria-hidden="true"></i>
									</div>
								</a>
		                    </figure>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>  
				<?php 
				 } 
			} ?>
		</div>			
	</div>
	<div class="clearfix"></div>
</section>
<?php }