<?php if ( get_theme_mod('pr_services_projects_section_enable',true) ) : ?>

<div class="project py-5">
	<div class="container">
		<?php if ( get_theme_mod('pr_services_projects_heading') ) : ?>
			<h3 class="mb-4 wow fadeInDown"><?php echo esc_html(get_theme_mod('pr_services_projects_heading')); ?></h3>
		<?php endif; ?>
		<div class="tab wow fadeInUp">
	        <?php $pr_services_featured_post = get_theme_mod('pr_services_projects_number', '');
	          	for ( $pr_services_j = 1; $pr_services_j <= $pr_services_featured_post; $pr_services_j++ ){ ?>
          		<button class="tablinks" onclick="pr_services_projects_tab(event, '<?php $pr_services_main_id = get_theme_mod('pr_services_projects_text'.$pr_services_j); $pr_services_tab_id = str_replace(' ', '-', $pr_services_main_id); echo $pr_services_tab_id; ?> ')">
	          	<?php echo esc_html(get_theme_mod('pr_services_projects_text'.$pr_services_j)); ?></button>
	        <?php }?>
      	</div>

  	  	<?php for ( $pr_services_j = 1; $pr_services_j <= $pr_services_featured_post; $pr_services_j++ ){ ?>
	        <div id="<?php $pr_services_main_id = get_theme_mod('pr_services_projects_text'.$pr_services_j); $pr_services_tab_id = str_replace(' ', '-', $pr_services_main_id); echo $pr_services_tab_id; ?>"  class="tabcontent mt-5">
		        <?php $pr_services_args = array(
					'post_type' => 'post',
					'post_status' => 'publish',
					'category_name' =>  get_theme_mod('pr_services_projects_category'.$pr_services_j),
					'posts_per_page' => 6,
				); ?>
				<div class=" owl-carousel">
				    <?php $pr_services_arr_posts = new WP_Query( $pr_services_args );
				    	if ( $pr_services_arr_posts->have_posts() ) :
				      	while ( $pr_services_arr_posts->have_posts() ) :
				        $pr_services_arr_posts->the_post();
				        ?>
					        <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/post1.png'; ?>">
						              </div>
						              <?php
						            endif;
						          ?>
								<div class="projects_content_box">
					        		<h4 class="mb-0"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
					        		<div class="date-box">
					        			<span class="me-4"><?php echo esc_html('Created','pr-services'); ?></span><?php echo get_the_date(); ?>
					        		</div>
					            </div>
					        </div>
				      	<?php
				    endwhile;
				    wp_reset_postdata();
				    endif; ?>
				</div>
			</div>
		<?php }?>
		<div class="mt-lg-4 mb-5 about-btn text-center">
          <?php if ( get_theme_mod('pr_services_about_button_url', ) || get_theme_mod('pr_services_about_button_text',) ) : ?>
            <a href="<?php echo esc_url(get_theme_mod('pr_services_about_button_url'));?>" class="button animate__animated animate__pulse">
            <?php echo esc_html(get_theme_mod('pr_services_about_button_text'));?></a>
          <?php endif; ?>
        </div>
	</div>
</div>

<?php endif; ?>