<?php
/**
 * Template part for displaying posts.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package dexen
 */
    $blog_post_padding = dexen_get_options('blog_post_padding');
        
    $blog_post_padding_class = "extra-padding-off";
    if( $blog_post_padding == '1'):
        $blog_post_padding_class = "";
    endif;
    $blog_single_post_thumb = dexen_get_options('blog_single_post_thumb');


    $blog_signle_tag = dexen_get_options('blog_signle_tag');
    $blog_signle_tag_text = dexen_get_options('blog_signle_tag_text');
    $is_no_post_thumb = '';
    if (!has_post_thumbnail()) {
        $is_no_post_thumb = 'no-post-thumb';
    }
?>
<?php if (has_post_thumbnail()) : ?>
    <div class="blog-details__image">
        <?php dexen_post_thumbnail(); ?>
    </div><!-- /.blog-details__image -->
<?php endif; ?>
<div class="blog-details__content thm-gray-bg">
    <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"><?php the_title(); ?></h3>
    <?php the_content(); ?>
    <?php
        wp_link_pages(
            array(
                'before' => '<div class="page-links">',
                'after' => '</div>',
            )
        );
    ?>
</div><!-- /.blog-details__content -->
<div class="blog-details__tags-share thm-gray-bg">
    <div class="blog-details__tags">
        <span class="blog-details__tags-title"><?php esc_html_e('Tags','dexen');?></span>
        <?php dexen_tag_list(); ?> 
    </div><!-- /.blog-details__tags -->
</div><!-- /.blog-details__tags-share -->
<?php 
$display_name = get_the_author_meta('display_name', $post->post_author);
$user_text = get_the_author_meta('user_description', $post->post_author);
$user_avatar = get_avatar($post->post_author, 160);
if (isset($user_text) && !empty($user_text)) {
?>
<div class="blog-details__author thm-gray-bg">
    <div class="blog-details__author-image">
        <?php echo wp_kses($user_avatar,'author_avatar'); ?>
    </div><!-- /.blog-details__author-image -->
    <div class="blog-details__author-content">
        <h3 class="blog-details__author-title"><?php echo esc_html(ucfirst($display_name)); ?></h3><!-- /.blog-details__author-title -->
        <p class="blog-details__author-text"><?php echo esc_html($user_text); ?></p><!-- /.blog-details__author-text -->
    </div><!-- /.blog-details__author-content -->
</div><!-- /.blog-details__author -->
<?php } ?>