<?php
/**
 *
 * @package Luzuk
 */
if(get_theme_mod('luzuk_them_gallery_section_disable') != 'on' ){ ?>  
	<?php 
							if( get_theme_mod('sec_gallerysectionTpadding',true) ) {
								$sec_gallerysectionTpadding = 'padding-top:'.esc_attr(get_theme_mod('sec_gallerysectionTpadding')).';';
							}
							if( get_theme_mod('sec_gallerysectionBpadding',true) ) {
								$sec_gallerysectionBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('sec_gallerysectionBpadding')).';';
							}
							if( get_theme_mod('sec_gallerysectionLpadding',true) ) {
								$sec_gallerysectionLpadding = 'padding-left:'.esc_attr(get_theme_mod('sec_gallerysectionLpadding')).';';
							}
							if( get_theme_mod('sec_gallerysectionRpadding',true) ) {
								$sec_gallerysectionRpadding = 'padding-right:'.esc_attr(get_theme_mod('sec_gallerysectionRpadding')).';';
							}
							?>
<section id="ht-gallery-section" class="lz-gallery-section">
			
	<div class="lightbox" style="<?php echo esc_attr($sec_gallerysectionTpadding); ?>" "<?php echo esc_attr($sec_gallerysectionBpadding); ?>" "<?php echo esc_attr($sec_gallerysectionLpadding); ?>" "<?php echo esc_attr($sec_gallerysectionRpadding); ?>">


			<?php			
			$luzuk_them_gallery_title = get_theme_mod('luzuk_them_gallery_title', 'Photo Gallery');
			
			 $luzuk_them_gallery_sub_title = get_theme_mod('luzuk_them_gallery_sub_title', 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words.');
			?>
			<div class="row">
					<div class="ht-section-title-tagline">
					<div class="gallery-head-box">					
						<h2 class="ht-section-title lz-gallery-heading">
							<?php
							if(!empty($luzuk_them_gallery_title))	{
								echo ($luzuk_them_gallery_title);
							} ?>
						</h2> 
					</div>
						<div class="clearfix"></div> 
						<div class="titlebor"></div>
					</div>
						<div class="clearfix"></div>
						<div class="col-md-6 col-md-offset-3 lz-gallery-subheading text-center">
							<?php
							if(!empty($luzuk_them_gallery_sub_title))	{
								echo ($luzuk_them_gallery_sub_title);
							} ?>
						</div>
					
				<div class="clearfix"></div>
			</div>


		<div class="gallery-main-box col-md-12"> 
			<div class="row">
			<!-- <div class="ht-team-member-wrap ht-clearfix"> -->
				<?php 
				$showStatic = true;
				$cols = get_theme_mod('luzuk_them_gallery_npp_count', 3);
				$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:
						$colCls = 'col-md-4 col-sm-6';
						break;
						case 4:
						case 7:
						case 8:
						case 10:
						case 11:
						case 12:
						$colCls = 'col-md-4 col-sm-6';
						break;
						default: 
						$colCls = 'col-md-4 col-sm-6';
						break;
				}
				for( $i = 1; $i <= $cols; $i++ ){
					$luzuk_them_gallery_page_id = get_theme_mod('luzuk_them_gallery_page'.$i); 
					$luzuk_them_gallery_page_icon = get_theme_mod('luzuk_them_gallery_page_icon'.$i);
					if($luzuk_them_gallery_page_id){
						$showStatic = false;
						echo galleryShortCode($luzuk_them_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="col-md-4 col-sm-6 col-xs-12 lz-gallery-images padding2 wow zoomIn">
								<figure class="gallery-img-bx">
									<img class="secondry-bg img-responsive" src="<?php echo esc_url($thumb_url); ?>" alt="<?php the_title(); ?>" />	
									<figcaption>

									</figcaption>
									<a class="group1" href="<?php echo esc_url($thumb_url); ?>" title="<?php the_title(); ?>">
									<span class="roll" ><h6><?php the_title(); ?></h6></span>
								</a>
								</figure>
							</div>
					<?php 
					$i++; } wp_reset_query();
				} ?>

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

