<?php
$show_article_popular  = ot_get_option('show_article_popular', true);
if ($show_article_popular  == 'on') :
    get_template_part('themeplat/content/article/article-popular', 'popular');
endif; ?>
<div class="container main-content single_4">
    <div class="row">
        <?php do_action('top_post_widget'); ?>
        <div class="col-sm-12 col-lg-9 pal_0">
            <div class="single-hero-inside position-relative mb-3">
                <div class="image-container">
                    <?php
                    if (has_post_thumbnail()) : ?>
                    <a href="<?php the_permalink() ?>" title="<?php the_title() ?>">
                        <?php the_post_thumbnail('singlethumbnail') ?>
                    </a>
                    <?php else : ?>
                    <a href="<?php the_permalink() ?>" title="<?php the_title() ?>">
                        <img src="<?php bloginfo('template_url'); ?>/assets/image/search-bar.gif" width="60" height="60"
                            alt="<?php _e('Image not found', 'leora'); ?>"
                            title="<?php _e('Image not found', 'leora'); ?>">
                    </a>
                    <?php endif; ?>
                </div>
                <div class="article-header">
                    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                    <div id="breadcrumbs">
                        <div class="breadcrumb_DB" style="border-radius:10px 10px 0 0;">
                            <?php get_breadcrumb(); ?>
                        </div>
                    </div>
                    <h1><?php the_title(); ?></h1>
                    <?php
                        $avatar_single_4  = ot_get_option('avatar_single_4', false);
                        if ($avatar_single_4  == 'off') : 
                    ?>
                    <span style="position:absolute;top: 0;padding: 10px 0;">
                        <time  style="font-size:12px;"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' پیش'; ?></time>
                    </span>
                    <?php endif;
                          $avatar_single_4  = ot_get_option('avatar_single_4', true);
                          if ($avatar_single_4  == 'on') : 
                    ?>
                    <div class="rightsidebar col-md-12" style="padding: 0;">
                        <div class="author-avatar">
                            <?php echo get_avatar(get_the_author_meta('ID'), 96); ?>
                        </div>
                        <div class="author-details">
                            <div itemprop="author" class="author-details-row1">
                                <?php _e('author ', 'leora'); ?>:
                                <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>">
                                    <span itemprop="name"
                                        class="item__details--author"><?php the_author_meta('display_name'); ?></span>
                                </a>
                                __
                                <span>
                                    <time><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' پیش'; ?></time>
                                </span>
                                <?php if (info_content_get_meta('info_content_version')) : ?>
                                <span class="version_undefined">
                                    <?php _e('Study time ', 'leora'); ?>:
                                    <span><?php echo info_content_get_meta('info_content_version'); ?></span>
                                </span>
                                <?php endif; ?>
                            </div>
                        </div>

                    </div>
                    <?php endif; endwhile; endif;?>
                </div>
            </div>
            <div class="col-12" style="padding:0px">
                <div class="post sin-content">
                    <div class="post-content">
                        <?php the_content(); ?>
                    </div>
                    <?php get_template_part('themeplat/single/source', 'source'); ?>
                </div>
            </div>
            <?php get_template_part('themeplat/single/post-required', 'required'); ?>
        </div>
        <?php 
            get_sidebar('right');
            do_action('down_post_widget');
        ?>
    </div>
</div>
</div>
<?php get_template_part('themeplat/single/read-more', 'read-more'); ?>