<?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://codex.wordpress.org/Template_Hierarchy
 *
 * @package Hotel 26
 */

get_header(); 
?>
<section id="post-section" class="index post-section st-py-default">
	<div class="container">
		<div class="row g-2 g-sm-3 g-lg-4">			 	
				<div class="col-12">
				<?php 
					global $paged;
					$j=1;
					$paged = max(1, get_query_var('paged'), get_query_var('page'));
					$args = array( 'post_type' => 'post','paged'=>$paged, 'posts_per_page' => get_option('posts_per_page') );	
				?>
					<div class="row g-2 g-sm-3 g-lg-4">
				<?php
					$blog = new WP_Query( $args ); 
					if( $blog -> have_posts() ): ?>
					<?php while( $blog -> have_posts() ) : $blog -> the_post();  ?>
										
					<div class="col-lg-4 col-md-6 col-12 wow fadeIn" data-wow-delay="<?php echo esc_attr($j * 100); ?>ms" data-wow-duration="1500ms">					
						<?php	get_template_part('template-parts/content/content','page');  ?>
						</div>
					<?php  $j++; endwhile; wp_reset_postdata(); ?>
					
					<!--Pagination -->
					<?php 
						if ($blog->max_num_pages > 1) {
							$Hotel_26_pagination = new Hotel_26_pagination();
							$Hotel_26_pagination->Hotel_26_page($paged, $blog);
						}
					?>
					</div>			
				
				<?php else: ?>
					<?php get_template_part('template-parts/content/content','none'); ?>
				<?php endif; ?>
			</div>
		</div>
	</div>
</section>
<?php get_footer(); ?>
