<?php  

if(get_theme_mod('gallery_section_disable') != 'on' ){ ?>  
	
<section id="gallery" class="area-inner">
	<div class="container"> 
		<?php
			$gallery_page_id = get_theme_mod('gallery_page');
			$gallery_subtitle = get_theme_mod('gallerysubtitle', 'Gallery');
			$gallery_maintitle = get_theme_mod('gallery_maintitle', 'Your Forever Memories');
			
		?>
		<div class="section-title-area">
            <div class="section-title">
                <h4><?php echo ($gallery_subtitle); ?></h4>
                <h2><?php echo ($gallery_maintitle); ?></h2>              
            </div>
            <div class="clearfix"></div>  
        </div>
		<div class="gallery-main-box">
			<div class="row">
				<!-- <div class="ht-team-member-wrap ht-clearfix"> -->
			<?php 
				$showStatic = true;
				$cols = get_theme_mod('gallery_npp_count', 4);
				$cols++;
				switch($cols){
				case 1:
				$colCls = 'col-md-12 col-sm-12';
				break;
				case 2:	
				$colCls = 'col-md-6 col-sm-6';
				break;
				case 3:
				case 5:
				case 6:
				case 9:
				case 11:
				$colCls = 'col-md-4 col-sm-6';
				break;
				default: 
				$colCls = 'col-md-3 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);
					}
				}

				$args = array(
					'post_type' => 'our-gallery',
					'post_status' => 'publish'
				);
				$new = new WP_Query($args); 
				$i=1;
				if($showStatic == true){
				while ( $new->have_posts() ){
					$new->the_post(); 
					$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'medium_large' );
					if(has_post_thumbnail()) { $thumb_url = $thumb['0']; }
					$url = $thumb['0'];?>
				<div class="gllbx ">
					<div class="lz-gallery-images">
						<a data-fancybox="gallery" href="<?php echo esc_url($thumb_url); ?>" title="<?php the_title(); ?>">
							<figure class="spa-gall">
								<img class="secondry-bg img-responsive" src="<?php echo esc_url($thumb_url); ?>" alt="<?php the_title(); ?>" />
								<div class="ovlay"></div>			
								<div class="over-text">
									<h3>Wedding Dinner</h3>
								</div>
								<div class="icnbx"><i class="fa fa-eye"></i> </div>
							</figure>
						</a>
						<div class="clearfix"></div>
					</div>
				</div> 
				<?php 
					$i++; } wp_reset_query();
				} ?>

			</div>
		</div>			
	</div> 
	<div class="clearfix"></div>
</section>
<?php }

