<?php if ('layout_one' == $settings['layout_type']) : ?>
	<!-- Blog section Start -->
	<section class="blog-one blog-one--home">
		<div class="container">
			<?php if (!empty($settings['sec_sub_title'] || $settings['sec_title'])) : ?>
				<div class="sec-title text-center wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='000ms'>
					<?php if (!empty($settings['sec_sub_title'])) : ?>
						<div class="d-flex align-items-center justify-content-center">
							<?php ostech_elementor_rendered_image($settings, 'title_img', 'sec-title__img'); ?>
							<?php
							if (!empty($settings['sec_sub_title'])) :
								$this->add_inline_editing_attributes('sec_sub_title', 'none');
								ostech_elementor_rendered_content($this, 'sec_sub_title', 'sec-title__tagline', $settings['section_sub_title_tag_layout_one']);
							endif; ?>
						</div>
					<?php endif; ?>
					<?php if (!empty($settings['sec_title'])) :
						$this->add_inline_editing_attributes('sec_title', 'none');
						ostech_elementor_rendered_content($this, 'sec_title', 'sec-title__title', $settings['section_title_tag_layout_one']);
					endif;
					?>
				</div>
			<?php endif; ?>
			<div class="row gutter-y-30">
				<?php
				$blog_post_one_query_paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
				if (!empty($settings['select_category'])) :
					$blog_post_one_query_args = array(
						'post_type' => 'post',
						'post_status' => 'publish',
						'ignore_sticky_posts' => true,
						'orderby' => 'date',
						'order'   => $settings['query_order'],
						'posts_per_page' => $settings['post_count']['size'],
						'paged'          => $blog_post_one_query_paged,
						'tax_query' => array(
							array(
								'taxonomy' => 'category',
								'field' => 'slug',
								'terms' => $settings['select_category']
							)
						)
					);
				else :
					$blog_post_one_query_args = array(
						'post_type' => 'post',
						'post_status' => 'publish',
						'ignore_sticky_posts' => true,
						'orderby' => 'date',
						'paged'          => $blog_post_one_query_paged,
						'order'   => $settings['query_order'],
						'posts_per_page' => $settings['post_count']['size']
					);

				endif;
				$blog_post_one_query = new \WP_Query($blog_post_one_query_args);
				$i = 1;

				while ($blog_post_one_query->have_posts()) :
					$blog_post_one_query->the_post();

					$comments_number = get_comments_number();
					$user = wp_get_current_user();
					$author_id = get_the_author_meta('ID');
					$author_img = get_avatar_url($author_id, array("size" => 31));
				?>
					<div class="col-md-6 col-lg-4">
						<div class="blog-card wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='000ms'>
							<?php if (has_post_thumbnail()) : ?>
								<div class="blog-card__image">
									<?php the_post_thumbnail('ostech_blog_370X290'); ?>
									<?php the_post_thumbnail('ostech_blog_370X290'); ?>
									<a href="<?php the_permalink(); ?>" class="blog-card__image__link"></a>
									<div class="blog-card__date"><span><?php echo get_the_date("d") ?></span><?php echo get_the_date("M"); ?></div>
								</div>
							<?php endif; ?>
							<div class="blog-card__content">
								<ul class="list-unstyled blog-card__meta ml-0">
									<li>
										<a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"><img src="<?php echo esc_url($author_img); ?>" alt="<?php echo bloginfo('name') ?>">
											<?php the_author(); ?></a>
									</li>
									<?php if (!empty(get_comments_number())) : ?>
										<li><?php ostech_comment_count(); ?></li>
									<?php endif; ?>
								</ul>
								<div class="blog-card__content__inner">
									<?php $post_title = substr(get_the_title(), 0, $settings['post_title_count']['size']) ?>
									<h3 class="blog-card__title"><a href="<?php the_permalink() ?>"><?php echo esc_html($post_title); ?></a></h3>
									<a href="<?php the_permalink(); ?>" class="blog-card__link"><?php echo esc_html($settings['read_more']); ?>
										<?php \Elementor\Icons_Manager::render_icon($settings['blog_icon'], ['aria-hidden' => 'true'], 'i'); ?>
									</a><!-- /.blog-card__link -->
								</div>
							</div>
						</div>
					</div>
				<?php endwhile; ?>
				<?php if ('yes' == $settings['pagination_status']) : ?>
					<div class="wp-pagination blog-pagination portfolio-page__btn-box justify-content-center text-center">
						<?php ostech_custom_query_pagination($blog_post_one_query_paged, $blog_post_one_query->max_num_pages); ?>
					</div><!-- /.blog-post-pagination -->
				<?php endif; ?>
				<?php wp_reset_postdata(); ?>
			</div>
		</div>
	</section>
	<!-- Blog section End -->


<?php endif; ?>