<?php
/**
 * The main template file.
 *
 * This template is used to display a list of posts when no specific template is found.
 *
 * @package leatherhouse
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Prevent direct access.
}

get_header();
?>

<section id="post-section" class="post-section av-py-default">
	<div class="av-container-full">
		<div class="av-columns-area">
			<?php
				$leatherhouse_archive_blog_pages_layout = get_theme_mod( 'leatherhouse_archive_blog_pages_layout', 'leatherhouse_right_sidebar' );
				if ( 'leatherhouse_left_sidebar' === $leatherhouse_archive_blog_pages_layout ) {
					get_sidebar();
				}
			?>
			<div id="av-primary-content" class="<?php esc_attr( leatherhouse_post_layout() ); ?>">

				<?php
					$leatherhouse_paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
					$args        = array(
						'post_type' => 'post',
						'paged'     => $leatherhouse_paged,
					);
				?>
				<?php 
					if ( have_posts() ) : 
						while ( have_posts() ) :
							the_post();
							get_template_part( 'template-parts/content/content', 'page' );
						endwhile;

						// Pagination
						get_the_posts_pagination(
							array(
								'mid_size'  => 1,
								'prev_text' => '<i class="fa fa-angle-double-left"></i>',
								'next_text' => '<i class="fa fa-angle-double-right"></i>',
							)
						);
						// Pagination
					else:
						get_template_part( 'template-parts/content/content', 'none' );
					endif;
				?>

			</div>
			<?php 
				if ( 'leatherhouse_right_sidebar' === $leatherhouse_archive_blog_pages_layout ) {
					get_sidebar();
				}
			?>
		</div>
	</div>
</section>
<?php get_footer(); ?>


