<?php
/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package    Wira
 * @since      1.0.0
 */

?>

<?php get_header(); ?>

<!-- Main Wrapper -->
<main id="main">

	<!-- Theme Wrapper -->
	<div class="wira-theme">

		<!-- Title Banner -->
		<?php get_template_part( 'template-parts/title-banner' ); ?>

		<!-- Main Section Wrapper -->
		<div class="container theme-section theme-space-wider">

			<!-- Row -->
			<div class="row gx-lg-5 gy-5">

				<!-- Columns Content -->
				<div class="col">
					<div class="row row-cols-md-2 row-cols-1 gy-4 gx-lg-4">
						<?php
						if ( have_posts() ) :
							while ( have_posts() ) :
								the_post();
								get_template_part( 'template-parts/content/content' );
							endwhile;

						else :
							get_template_part( 'template-parts/content/content', 'none' );
						endif;
						?>
					</div>
					<?php
					if ( class_exists( 'Wira\Templates\Custom_Pagination' ) ) {
						$wira_pagination = new Wira\Templates\Custom_Pagination();
						$wira_pagination->render();
					}
					?>
				</div> <!-- Columns Content /End -->
				
				<!-- Sidebar Columns -->
				<?php get_sidebar(); ?>
			</div> <!-- Row /End -->
		</div> <!-- Main Section Wrapper /End -->
	</div> <!-- Theme Wrapper /End -->
</main> <!-- Main Wrapper /End -->

<?php get_footer(); ?>
