<?php if ( get_theme_mod('misbah_one_page_projects_section_enable',false) ) : ?>

<div class="project py-5">
	<div class="container">		
		<?php if ( get_theme_mod('misbah_one_page_projects_heading') ) : ?>
			<h3 class="text-center wow flip"><?php echo esc_html(get_theme_mod('misbah_one_page_projects_heading')); ?></h3>
			<hr>
		<?php endif; ?>
		<?php if ( get_theme_mod('misbah_one_page_projects_heading_text') ) : ?>
			<p class="pb-4 text-center"><?php echo esc_html(get_theme_mod('misbah_one_page_projects_heading_text')); ?></p>
		<?php endif; ?>
		<div class="tab text-center wow fadeInUp">
	        <?php $misbah_one_page_featured_post = get_theme_mod('misbah_one_page_projects_number', '');
	          	for ( $misbah_one_page_j = 1; $misbah_one_page_j <= $misbah_one_page_featured_post; $misbah_one_page_j++ ){ ?>
          		<button class="tablinks me-2 me-md-3" onclick="misbah_one_page_projects_tab(event, '<?php $misbah_one_page_main_id = get_theme_mod('misbah_one_page_projects_text'.$misbah_one_page_j); $misbah_one_page_tab_id = str_replace(' ', '-', $misbah_one_page_main_id); echo $misbah_one_page_tab_id; ?> ')">
	          	<?php echo esc_html(get_theme_mod('misbah_one_page_projects_text'.$misbah_one_page_j)); ?></button>
	        <?php }?>
      	</div>

  	  	<?php for ( $misbah_one_page_j = 1; $misbah_one_page_j <= $misbah_one_page_featured_post; $misbah_one_page_j++ ){ ?>
	        <div id="<?php $misbah_one_page_main_id = get_theme_mod('misbah_one_page_projects_text'.$misbah_one_page_j); $misbah_one_page_tab_id = str_replace(' ', '-', $misbah_one_page_main_id); echo $misbah_one_page_tab_id; ?>"  class="tabcontent mt-5">
		        <?php $misbah_one_page_args = array(
					'post_type' => 'post',
					'post_status' => 'publish',
					'category_name' =>  get_theme_mod('misbah_one_page_projects_category'.$misbah_one_page_j),
					'posts_per_page' => 9,
				); ?>
				<div class="owl-carousel">
				    <?php $misbah_one_page_arr_posts = new WP_Query( $misbah_one_page_args );
				    	if ( $misbah_one_page_arr_posts->have_posts() ) :
				      	while ( $misbah_one_page_arr_posts->have_posts() ) :
				        $misbah_one_page_arr_posts->the_post();
				        ?>
					        <div class="projects_inner_box mb-4 text-center 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>
					            </div>
					        </div>
					    
				      	<?php
				    endwhile;
				    wp_reset_postdata();
				    endif; ?>
				</div>
			</div>
		<?php }?>
	</div>
</div>

<?php endif; ?>
