<?php $currentlang = get_bloginfo('language'); ?>	
<?php if($currentlang=="bs-BA"): ?>	

<div class="w-full py-40">
	<div class="container">
		<!-- PAGE TITLE SECTION -->
		<div class="flex items-center">
			<h1 class="w-max bg-blue text-white my-0 px-40"><?php the_title(); ?></h1>
		</div>
		<!-- PAGE TITLE SECTION END -->

		<!-- PAGE CONTENT SECTION -->
		<div class="w-full pt-40">
			<div class="flex flex-wrap justify-start" id="projects-container">
				<?php
				// Initial loop to display the first 9 posts
				$args_initial = array(
					'post_type' => 'proizvodi',
					'post_status' => 'publish',
					'posts_per_page' => -1,
					'orderby' => 'date',
					'order'   => 'DESC',
				);
				$the_query_initial = new WP_Query($args_initial);
				while ($the_query_initial->have_posts()) {
					$the_query_initial->the_post();

						// Get post data
						$permalink = get_the_permalink();
						$thumbnail = get_the_post_thumbnail();
						$title = get_the_title();

						echo '<div class="item w-1-4 w-full-1080 p-20 text-center">';
							echo '<div class="py-40 px-20">';
								echo '<a href="' . esc_url($permalink) . '" class="mx-auto">' . $thumbnail . '</a>';
								echo '<h3 class="font-poppins-bold text-center px-20 mt-20 mb-20">' . esc_html($title) . '</h3>';
								echo '<p class="text-center font-uppercase px-20">';
									echo '<a href="' . esc_url($permalink) . '" class="text-blue bb1-blue">Pogledajte proizvod</a>';
								echo '</p>';
							echo '</div>';
						echo '</div>';
				}
				wp_reset_postdata();
				?>
			</div>
		</div>
		<!-- PAGE CONTENT SECTION END -->
	</div>
</div>

<?php elseif($currentlang=="en-GB"): ?>

	<div class="w-full py-40">
	<div class="container">
		<!-- PAGE TITLE SECTION -->
		<div class="flex items-center">
			<h1 class="w-max bg-blue text-white my-0 px-40"><?php the_title(); ?></h1>
		</div>
		<!-- PAGE TITLE SECTION END -->

		<!-- PAGE CONTENT SECTION -->
		<div class="w-full pt-40">
			<div class="flex flex-wrap justify-start" id="projects-container">
				<?php
				// Initial loop to display the first 9 posts
				$args_initial = array(
					'post_type' => 'proizvodi',
					'post_status' => 'publish',
					'posts_per_page' => -1,
					'orderby' => 'date',
					'order'   => 'DESC',
				);
				$the_query_initial = new WP_Query($args_initial);
				while ($the_query_initial->have_posts()) {
					$the_query_initial->the_post();

						// Get post data
						$permalink = get_the_permalink();
						$thumbnail = get_the_post_thumbnail();
						$title = get_the_title();

						echo '<div class="item w-1-4 w-full-1080 p-20 text-center">';
							echo '<div class="py-40 px-20">';
								echo '<a href="' . esc_url($permalink) . '" class="mx-auto">' . $thumbnail . '</a>';
								echo '<h3 class="font-poppins-bold text-center px-20 mt-20 mb-20">' . esc_html($title) . '</h3>';
								echo '<p class="text-center font-uppercase px-20">';
									echo '<a href="' . esc_url($permalink) . '" class="text-blue bb1-blue">View product</a>';
								echo '</p>';
							echo '</div>';
						echo '</div>';
				}
				wp_reset_postdata();
				?>
			</div>
		</div>
		<!-- PAGE CONTENT SECTION END -->
	</div>
</div>

<?php endif; ?>
