<?php
/**
 *
 * @package Luzuk Premium
 */
if(get_theme_mod('lz_fitness_gallery_section_disable') != 'on' ){ 
	wp_enqueue_script('product-category-slider', get_template_directory_uri().'/js/slider.js', array(), '1.1', true);
	?>
<section id="ht-gallery-section" class="lz-gallery-section">
			<div class="container">
				<!-- <div class="wave-border">
					<svg viewBox="0 0 120 7">
	                <pattern x="-7.5" id="waves" patternUnits="userSpaceOnUse" width="10" height="7">
	                  <path d="M0 10 V5 Q2.5 2.5 5 5 T10 5 V10"></path>
	                </pattern>
	                <rect x="0" y="0" width="120" height="7" fill="url(#waves)"></rect>
	                </svg>
	          </div> -->
	          <div class="clearfix"></div>
			<?php			
			$lz_fitness_gallery_title = get_theme_mod('lz_fitness_gallery_title', 'Our Sweet Works');
			?>
			<div class="row">
					<div class="ht-section-title-tagline">
						<h2 class="ht-section-title lz-gallery-heading">
							<?php
							if(!empty($lz_fitness_gallery_title))	{
								echo ($lz_fitness_gallery_title);
							} ?>
						</h2> 
						<div class="dlab-separator-outer m-b0">
							<div class="dlab-separator text-primary style-icon"><i class="fa fa-birthday-cake"></i></div>
						</div>
					</div>
				<div class="clearfix"></div>
			</div>
		
			<div class="row">
			<!-- <div class="ht-team-member-wrap ht-clearfix"> -->

				<div class="slider" id="slider">
					<div class="slides" id="slides">

				<?php 
				$showStatic = true;
				$cols = get_theme_mod('lz_fitness_gallery_npp_count', 7);
				$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:
					// 	$colCls = 'col-md-4 col-sm-6';
					// 	break;
					default: 
						$colCls = 'col-md-3 col-sm-6';
						break;
				}
				for( $i = 1; $i <= $cols; $i++ ){
					$lz_fitness_gallery_page_id = get_theme_mod('lz_fitness_gallery_page'.$i); 
					$lz_fitness_gallery_page_icon = get_theme_mod('lz_fitness_gallery_page_icon'.$i);
					if($lz_fitness_gallery_page_id){
						$showStatic = false;
						echo galleryShortCode($lz_fitness_gallery_page_id, $isCustomizer=true, $i);
					}
				}

				$args = array(
				  'post_type' => 'lz_fitness_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-3 lz-gallery-images slide-item"><a class="group1" href="<?php echo esc_url($thumb_url); ?>" title="<?php the_title(); ?>"><img class="secondry-bg img-responsive" src="<?php echo esc_url($thumb_url); ?>" alt="<?php the_title(); ?>" />	
						</a>
					</div>
					<?php 
					$i++; } wp_reset_query();
				} ?>
				</div>
				<button class="ctrl-btn pro-prev slide-prev"><i class="fa fa-chevron-left"></i></button>
				<button class="ctrl-btn pro-next slide-next"><i class="fa fa-chevron-right"></i></button>
			</div>

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

