<?php  
	$blog_title			= pll__(get_theme_mod('blog_title','Blog'));
	$blog_subtitle		= pll__(get_theme_mod('blog_subtitle','Our Blog'));
	$blog_display_num	= get_theme_mod('blog_display_num','3'); 
?>
	<!-- blog section -->
    <section class="blog-section post-home">
        <div class="container">
            <?php if(!empty($blog_title)  || !empty($blog_subtitle)){ ?>
				<div class="section-title">
					<?php if(!empty($blog_subtitle)): ?>
						<div class="section-heading">
							<?php echo esc_html($blog_subtitle); ?>
						</div>
					<?php endif; ?>
					
					<?php if(!empty($blog_title)): ?>
						<p class="animation">
							<span>
								<?php echo esc_html($blog_title); ?>
							</span>
						</p>
					<?php endif; ?>	
				</div>
			<?php } ?>
			
            <div class="row">
				<?php 
					$glides_blog_args = array( 'post_type' => 'post', 'posts_per_page' => $blog_display_num,'post__not_in'=>get_option("sticky_posts")) ;  	
					
					$glides_wp_query = new WP_Query($glides_blog_args);
					if($glides_wp_query)
					{
					while($glides_wp_query->have_posts()):$glides_wp_query->the_post();
					

				?>
					<div class="col-lg-4">
						<article class="post-item">
							
							<figure class="post-image">
								<?php if ( has_post_thumbnail() ) { the_post_thumbnail('medium'); } ?>
								<div class="meta top">
									<span class="date">
										<a href="#"><?php echo esc_html(get_the_date('j')); ?><span><?php echo esc_html(get_the_date('M')); ?></span></a>
									</span>
								</div>
							</figure>
							<div class="post-content">
								<div class="meta">
									<span class="admin"><a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))) ?>"  title="<?php echo esc_url(get_avatar_url(get_the_author_meta( 'name' ))) ?>"><i class="fa fa-user"></i> <?php esc_html(the_author()); ?></a></span>
									<?php
                                        $categories = get_the_category(); // Get the categories associated with the post
                                        if ($categories) { // Check if there are categories available
                                            ?>
                                            <span class="Category">
                                                <a href="#"><i class="fa fa-folder-open"></i> <?php the_category('', ''); ?></a>
                                            </span>
                                            <?php
                                        }
                                    ?>
									<?php if(has_tag()){ ?>
										<span class="tags"><a href="#"><i class="fa fa fa-tags"></i> <?php the_tags('',''); ?></a></span>
									<?php } ?>
								</div>
								<?php    
									the_title( sprintf( '<h2 class="post-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
									the_excerpt();
								?>
								<a href="<?php echo esc_url(get_permalink()) ?>" target="_blank" class="btn btn-border-4"><?php echo esc_html__('Read More','glides'); ?> </a>
							</div>
						</article>
					</div>
                <?php 
					endwhile; 
					}
					wp_reset_postdata();
				?>
            </div>
        </div>
    </section>
    <!-- end -->