<?php if ('layout_four' == $settings['layout_type']) : ?>
	<!-- Blog section Start -->
	<section class="blog-three" id="blog">
		<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" => 40));
				?>
					<div class="col-md-6 col-lg-4">
						<div class="blog-card-three wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='000ms'>
							<?php if (has_post_thumbnail()) : ?>
								<div class="blog-card-three__image">
									<?php the_post_thumbnail('ostech_blog_370X470'); ?>
									<?php the_post_thumbnail('ostech_blog_370X470'); ?>
									<a href="<?php the_permalink(); ?>" class="blog-card-three__image__link"><span class="sr-only"><?php the_title(); ?></span></a>
									<div class="blog-card-three__date"><span><?php echo get_the_date("d") ?></span><?php echo get_the_date("M"); ?></div>
								</div>
							<?php endif; ?>
							<div class="blog-card-three__content">
								<div class="blog-card-three__content__inner">
									<?php if (!empty(get_comments_number())) : ?>
										<ul class="list-unstyled blog-card-three__meta ml-0">
											<li><?php ostech_comment_count(); ?></li>
										</ul>
									<?php endif; ?>
									<?php $post_title = substr(get_the_title(), 0, $settings['post_title_count']['size']) ?>
									<h3 class="blog-card-three__title"><a href="<?php the_permalink() ?>"><?php echo esc_html($post_title); ?></a></h3>
									<a href="<?php the_permalink(); ?>" class="blog-card-three__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; ?>
			</div>
		</div>
	</section>
	<!-- Blog section End -->
<?php endif; ?>