<?php
global $post;
$post_id = $post->ID;
$reading_time = get_the_reading_time($post_id);
$post_title = get_the_title($post_id);
$post_date = jdate('j F Y', get_post_timestamp($post_id));
$categories = get_the_category($post_id);
$post_permalink = get_the_permalink($post_id); ?>
<div class="main">
    <div class="singleblog rt">
        <section class="post-side right">
            <article class="rt-post rt rt-bg rt-shadow rt-10px">
                <h1 class="title rt rt-bold rt-25 rt-222"><?php echo $post_title; ?></h1>
                <span class="btn-share rt-pointer left rt-8px rt-999 rt-17 rt-center"><i class="fa fa-share-alt"></i></span>
                <input id="myinputa" type="text" style="display:none" value="<?php echo $post_permalink; ?>">
                <ul class="info rt rt-14 rt-888">
                    <?php if (!empty($categories)) : ?>
                        <li class="right">
                            <?php foreach ($categories as $cat) : ?>
                                <a href="<?php echo get_category_link($cat->term_id); ?>" rel="category tag"><?php echo $cat->name; ?></a>
                            <?php endforeach; ?>
                        </li>
                    <?php endif; ?>
                    <li class="tags"><?php the_tags(); ?></li>
                    <li class="right"><i class="fa fa-clock right rt-16"></i> مطالعه <?php echo $reading_time; ?> دقیقه زمان می برد</li>
                    <li class="left"><i class="fa fa-calendar-day right rt-16"></i> منتشر شده در <?php echo $post_date; ?> </li>
                </ul>
                <?php if (has_post_thumbnail($post_id)) : ?>
                    <a href="<?php echo $post_permalink; ?>" rel="bookmark" class="pic" title="<?php echo $post_title; ?>">
                        <?php the_post_thumbnail('full', array("alt" => $post_title)); ?>
                    </a>
                <?php endif; ?>
                <div class="rt-matn rt-16 rt-ddd rt">
                    <?php the_content(); ?>
                </div>
            </article>
            <?php comments_template(); ?>
        </section>
        <?php get_template_part('templates/single/blog/sidebar'); ?>
    </div>
</div>