<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package dexen
 */

$blog_post_style = dexen_get_options('blog_post_style');
$blog_post_style_class = 'col-lg-12';
if($blog_post_style == '2') :
	$blog_post_style_class = 'col-lg-6';
endif;
?>
<div class="<?php echo esc_attr( $blog_post_style_class )?>">
	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<div class="blog-one__single content-margin-80 text-center">
			<?php if (has_post_thumbnail()) : ?>
			<div class="blog-one__image-block">
				<?php dexen_post_thumbnail(); ?>
			</div><!-- /.blog-one__image-block -->
			<?php endif; ?>
			<div class="blog-one__text-block thm-gray-bg">
				<?php if (is_sticky()) { ?>
					<div class="sticky_post_icon" title="<?php esc_attr_e('Sticky Post', 'dexen') ?>"><span class="fa fa-map-pin"></span></div>
				<?php } ?>
				<div class="blog-one__meta">
					<a class="blog-one__meta-item" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><i class="fa fa-user"></i><?php esc_html_e('by ','dexen');?><?php echo esc_html( get_the_author() ); ?></a>
					<a class="blog-one__meta-item" href="<?php echo esc_url(get_permalink()); ?>"><i class="fa fa-calendar"></i><?php dexen_posted_on(); ?></a>
					<?php dexen_comments_count(); ?>
				</div><!-- /.blog-one__meta -->
				<h3 class="blog-one__title"><a href="<?php echo esc_url(get_permalink()); ?>"><?php the_title();?></a></h3>
				<div class="blog-one__text">					
					<?php
						if (get_option('rss_use_excerpt')) {
							the_excerpt();
						} else {
							the_excerpt();
						}

						wp_link_pages(array(
							'before' => '<div class="page-links">',
							'after' => '</div>',
						));
					?>
				</div><!-- /.blog-one__text -->
				<a href="<?php echo esc_url(get_permalink()); ?>" class="blog-one__link"><i class="fa fa-angle-right"></i></a>
			</div><!-- /.blog-one__text-block -->
		</div><!-- /.blog-one__single -->
	</article>
</div><!-- /.col-lg-6 -->