<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package razan-payamava
 */

get_header();
?>

<main id="primary" class="site-main singlePageParent">

	<?php
	while (have_posts()):
		the_post();

		get_template_part('template-parts/content', get_post_type());


	endwhile; 
	?>

</main>










<?php

$args_post = [
	'post_type' => 'post',
	'posts_per_page' => 4,
	'orderby' => 'date',
	'order' => 'DESC',
	'post_status' => 'publish',
	'post__not_in' => [get_the_ID()],
];

$recent_post = new WP_Query($args_post);


?>
<?php if ($recent_post->have_posts()) { ?>

	<div class="homeBlogSectionBack" id="recentPosts">

		<div class="homeBlogSection mainView">

			<div class="mainHeadingSite">
				<span>SIMILAR EVENTS</span>
				<h2 class="TitleSecProducts">رویداد‌های مشابه</h2>
			</div>

			<div class="swiperHomeBlogParent">

				<div class="swiper swiperHomeBlog">

					<div class="swiper-wrapper">

						<?php

						while ($recent_post->have_posts()) {

							$recent_post->the_post();

							echo '<div class="swiper-slide">';

							get_template_part('template-parts/cards/content', 'post');

							echo '</div>';

						}

						?>

					</div>

				</div>


				<div class="nextPrevBtn">
					<div class="swiper-button-prev-swiperHomeBlog"><svg width="48" height="48" viewBox="0 0 48 48"
							fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M16 24C25.3726 24 22.6274 24 32 24M32 24L26 18M32 24L26 30" stroke="#1C274C"
								stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
							<path
								d="M4 24C4 14.5719 4 9.85786 6.92893 6.92893C9.85786 4 14.5719 4 24 4C33.4281 4 38.1421 4 41.0711 6.92893C44 9.85786 44 14.5719 44 24C44 33.4281 44 38.1421 41.0711 41.0711C38.1421 44 33.4281 44 24 44C14.5719 44 9.85786 44 6.92893 41.0711C4 38.1421 4 33.4281 4 24Z"
								stroke="#1C274C" stroke-width="2" />
						</svg>
					</div>
					<div class="swiper-button-next-swiperHomeBlog"><svg width="48" height="48" viewBox="0 0 48 48"
							fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M16 24C25.3726 24 22.6274 24 32 24M32 24L26 18M32 24L26 30" stroke="#1C274C"
								stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
							<path
								d="M4 24C4 14.5719 4 9.85786 6.92893 6.92893C9.85786 4 14.5719 4 24 4C33.4281 4 38.1421 4 41.0711 6.92893C44 9.85786 44 14.5719 44 24C44 33.4281 44 38.1421 41.0711 41.0711C38.1421 44 33.4281 44 24 44C14.5719 44 9.85786 44 6.92893 41.0711C4 38.1421 4 33.4281 4 24Z"
								stroke="#1C274C" stroke-width="2" />
						</svg>
					</div>
				</div>

				<div class="linkSIde">
					<a href="#" class="generalBtn">مشاهده همه</a>
				</div>

			</div>


		</div>
	</div>

<?php } ?>














<?php


$args_Project = [
	'post_type' => 'product',
	'posts_per_page' => 5,
	'orderby' => 'date',
	'order' => 'DESC',
	'post_status' => 'publish',
];

$recent_project = new WP_Query($args_Project);


?>
<?php if ($recent_project->have_posts()) { ?>

	<div class="projectsServicesBack" id="projectsRelated">

		<div class="projectsServices mainView">

			<div class="mainHeadingSite">
				<span>RELATED PRODUCTS</span>
				<h2>محصولات مرتبط</h2>
			</div>

			<div class="productSwiperBack">

				<div class="swiper productSwiper projectsServicesMain">

					<div class="swiper-wrapper projectsServicesInner">

						<?php

						while ($recent_project->have_posts()) {

							$recent_project->the_post();

							echo '<div class="swiper-slide">';

							get_template_part('template-parts/cards/content', 'product');

							echo '</div>';

						}

						?>
					</div>
				</div>

				<div class="nextPrevBtn">
					<div class="swiper-button-prev-productSwiper"><svg width="48" height="48" viewBox="0 0 48 48"
							fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M16 24C25.3726 24 22.6274 24 32 24M32 24L26 18M32 24L26 30" stroke="#1C274C"
								stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
							<path
								d="M4 24C4 14.5719 4 9.85786 6.92893 6.92893C9.85786 4 14.5719 4 24 4C33.4281 4 38.1421 4 41.0711 6.92893C44 9.85786 44 14.5719 44 24C44 33.4281 44 38.1421 41.0711 41.0711C38.1421 44 33.4281 44 24 44C14.5719 44 9.85786 44 6.92893 41.0711C4 38.1421 4 33.4281 4 24Z"
								stroke="#1C274C" stroke-width="2" />
						</svg>
					</div>
					<div class="swiper-button-next-productSwiper">
						<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M16 24C25.3726 24 22.6274 24 32 24M32 24L26 18M32 24L26 30" stroke="#1C274C"
								stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
							<path
								d="M4 24C4 14.5719 4 9.85786 6.92893 6.92893C9.85786 4 14.5719 4 24 4C33.4281 4 38.1421 4 41.0711 6.92893C44 9.85786 44 14.5719 44 24C44 33.4281 44 38.1421 41.0711 41.0711C38.1421 44 33.4281 44 24 44C14.5719 44 9.85786 44 6.92893 41.0711C4 38.1421 4 33.4281 4 24Z"
								stroke="#1C274C" stroke-width="2" />
						</svg>

					</div>
				</div>

				<div class="linkSIde">
					<a href="#" class="generalBtn">مشاهده همه</a>
				</div>

			</div>

		</div>
	</div>

<?php } ?>










<?php
get_footer();
