<?php $layout = get_layouts_by_slug($slug);
	  $u_info = get_user_info_by_slug($slug);
;?>
<?php foreach ($posts as $key=>$post) { ?>
	<div class=" <?= $layout=="1"?'col-lg-6':'col-lg-6';?> col-md-6 col-sm-6">
		<div class="single-blog style_3" data-aos="fade-up" data-aos-delay="<?= $key+1;?>00">
			<div class="blog-img">
				<?php if($post['is_video']==0): ?>
				<img src="<?= base_url(html_escape($post['thumb']));?>" alt="">
				<?php else: ?>
					<div class="videoWrapper">
						<iframe src="<?= html_escape($post['thumb']);?>" frameborder="0"></iframe>
					</div>
				<?php endif;?>
				<div class="post-category">
					<a href="<?= base_url('category-post/'.$slug.'/'.html_escape($post['cat_slug'])); ?>"><?= html_escape($post['cat_name']);?></a>
				</div>
			</div>
			<div class="blog-content">
				<div class="left_blog_content">
					<div class="blog-title">
						<h4><a href="<?= base_url('post/'.$slug.'/'.$post['slug']);?>"><?= character_limiter(html_escape($post['title']),30);?></a></h4>
						<div class="meta">
							<ul>
								<li><i class="fa fa-calendar"></i> <?= cl_format(html_escape($post['created_at']));?></li>
								
								<?php foreach ($post['tags'] as $tag): ?>
									<li><a href="<?= base_url('tag-post/'.$slug.'/'.html_escape($tag['tag_slug'])); ?>" class="tag_name"><?= $tag['tag_name']; ?></a></li>
								<?php endforeach ?>
									
								
							</ul>
						</div>
					</div>
					<p><?= character_limiter(html_escape($post['overview']),80);?></p>
					<a href="<?= base_url('post/'.$slug.'/'.$post['slug']);?>" class="box_btn btn_style_<?= get_user_info_by_slug($slug)['btn_style'];?>"><?= !empty(lang('see_more'))?lang('see_more'):"See More"?> <i class="fa fa-long-arrow-right"></i></a>
				</div>
				<div class="right_blog_content">
					<ul>
						<li><a href="javascript:;"><img src="<?php echo base_url($u_info['thumb']); ?>" alt=""></a></li>
						<li><a href="javascript:;"><?= html_escape($post['hit']);?> <p><i class="fa fa-eye"></i></p></a></li>
						<li><a href="javascript:;" onclick="window.open('http://www.facebook.com/sharer.php?u=<?= base_url('post/'.$slug.'/'.html_escape($post['slug']));?>', 'sharer', 'toolbar=0,status=0,width=620,height=280');"><i class="fa fa-facebook"></i></a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>
<?php } ?>