<?php if ( get_theme_mod('designer_services_projects_section_enable') ) : ?>

<div class="project py-5">
	<div class="container">
		<?php if ( get_theme_mod('designer_services_projects_heading') ) : ?>
			<h3 class="pb-4 text-center wow flip"><?php echo esc_html(get_theme_mod('designer_services_projects_heading')); ?></h3>
		<?php endif; ?>

		<div class="tab text-center">
	        <?php $designer_services_featured_post = get_theme_mod('designer_services_projects_number', '');
	          	for ( $designer_services_j = 1; $designer_services_j <= $designer_services_featured_post; $designer_services_j++ ){ ?>
          		<button class="tablinks me-2 mr-md-3" onclick="designer_services_projects_tab(event, '<?php $designer_services_main_id = get_theme_mod('designer_services_projects_text'.$designer_services_j); $designer_services_tab_id = str_replace(' ', '-', $designer_services_main_id); echo $designer_services_tab_id; ?> ')">
	          	<?php echo esc_html(get_theme_mod('designer_services_projects_text'.$designer_services_j)); ?></button>
	        <?php }?>
      	</div>

  	  	<?php for ( $designer_services_j = 1; $designer_services_j <= $designer_services_featured_post; $designer_services_j++ ){ ?>
	        <div id="<?php $designer_services_main_id = get_theme_mod('designer_services_projects_text'.$designer_services_j); $designer_services_tab_id = str_replace(' ', '-', $designer_services_main_id); echo $designer_services_tab_id; ?>"  class="tabcontent mt-4">
		        <?php $designer_services_args = array(
					'post_type' => 'post',
					'post_status' => 'publish',
					'category_name' =>  get_theme_mod('designer_services_projects_category'.$designer_services_j),
					'posts_per_page' => 9,
				); ?>
				<div class="row">
				    <?php $designer_services_arr_posts = new WP_Query( $designer_services_args );
				    	if ( $designer_services_arr_posts->have_posts() ) :
				      	while ( $designer_services_arr_posts->have_posts() ) :
				        $designer_services_arr_posts->the_post();
				        ?>
				        <div class="col-lg-4 col-md-6 col-sm-6">
					        <div class="projects_inner_box mb-4 wow zoomIn">
								 <?php
						            if ( has_post_thumbnail() ) :
						              the_post_thumbnail();
						            else:
						              ?>
						              <div class="slider-alternate">
						                <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/banner.png'; ?>">
						              </div>
						              <?php
						            endif;
						          ?>
								<div class="projects_content_box p-3">
					        		<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
					        		<p class="mb-0"><?php esc_html_e(' Created ','designer-services');?><span><?php echo esc_html(get_the_date()); ?></span></p>
					            </div>
					        </div>
					    </div>
				      	<?php
				    endwhile;
				    wp_reset_postdata();
				    endif; ?>
				</div>
			</div>
		<?php }?>
	</div>
</div>

<?php endif; ?>