<?php
/**
* Template Name: Blog Page
*/
get_header(); ?>
<!-- ================> Blog section start here <================== -->
<div class="blog blog-style2 padding--top padding--bottom bg-light">
<div class="container">
<div class="section__wrapper">
<div class="row g-4">
<div class="col-lg-8 col-12">
<div class="row g-4">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 6,
'paged' => $paged,
'post_status' => 'publish',
);
$blog_query = new WP_Query($args);
if ($blog_query->have_posts()) :
while ($blog_query->have_posts()) : $blog_query->the_post();
?>
<div class="col-md-6 col-12">
<div class="blog__item">
<div class="blog__inner">
<div class="blog__thumb">
<a href="<?php the_permalink(); ?>">
<?php if (has_post_thumbnail()) : ?>
<?php the_post_thumbnail('full'); ?>
<?php else : ?>
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/blog/07.jpg" alt="blog thumb">
<?php endif; ?>
</a>
</div>
<div class="blog__content">
<a href="<?php the_permalink(); ?>">
<h5><?php the_title(); ?></h5>
</a>
<ul class="blog__content-metapost">
<li><i class="far fa-calendar"></i> <?php echo get_the_date('d M Y'); ?></li>
<li><i class="fas fa-user"></i> <?php the_author(); ?></li>
<li><i class="fas fa-tag"></i> <?php the_category(', '); ?></li>
</ul>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>" class="default-btn move-right"><span>Read More</span></a>
</div>
</div>
</div>
</div>
<?php
endwhile;
?>
</div>
<?php aacharyarajnikant_pagination($blog_query); ?>
<?php
wp_reset_postdata();
else :
?>
<p>No blog posts found.</p>
<?php endif; ?>
</div>
<div class="col-lg-4 col-12">
<?php get_sidebar(); ?>
</div>
</div>
</div>
</div>
</div>
<!-- ================> Blog section end here <================== -->
<?php get_footer(); ?>