<?php get_header();
global $theme_options; ?>

<div class="container archive">
    <div class="row">
        <?php if ($theme_options['opt-blog-sidebar'] == 2){ ?>
        <div class="col-12 archive-list">
            <?php }elseif ($theme_options['opt-blog-sidebar'] == 1){ ?>
            <?php get_sidebar(); ?>
            <div class="col-12 col-lg-9 archive-list">

                <?php }elseif ($theme_options['opt-blog-sidebar'] == 3){ ?>
                <div class="col-12 col-lg-9 archive-list">
                    <?php } ?>

                    <?php
                    if (have_posts()) :
                        while (have_posts()) : the_post(); ?>
                            <div class="archive-box">
                                <a href="<?php echo get_the_permalink(); ?>"><?php the_post_thumbnail('archive-post-img'); ?></a>
                                <div class="d-block">
                                    <a href="<?php echo get_the_permalink(); ?>"><p><?php echo get_the_title(); ?></p>
                                    </a>
                                    <div><?php echo the_excerpt(); ?></div>
                                    <div class="archive-box-bottom">
                                        <?php if ($theme_options['opt-switch-blog-meta-author']) { ?>
                                            <div><i class="fas fa-user-edit i-custom"></i>نویسنده
                                            : <?php the_author(); ?></div><?php } ?>
                                        <?php if ($theme_options['opt-switch-blog-meta-category']) { ?>
                                            <div><i class="fas fa-tags"></i>دسته بندی : <?php echo the_category(); ?>
                                            </div><?php } ?>
                                        <?php if ($theme_options['opt-switch-blog-meta-time']) { ?>
                                            <div><i class="fas fa-clock"></i>تاریخ انتشار
                                            : <?php echo the_time('j F Y'); ?></div><?php } ?>
                                        <?php if ($theme_options['opt-switch-blog-meta-comments']) { ?>
                                            <div><i class="fas fa-comments"></i>دیدگاه
                                            : <?php echo comments_number(); ?></div><?php } ?>
                                    </div>
                                </div>
                            </div>
                        <?php endwhile;
                    endif;
                    ?>
                </div>


                <?php
                if ($theme_options['opt-blog-sidebar'] == 3) {
                    get_sidebar();
                }
                ?>
    </div>
</div>

    <?php
    get_footer(); ?>

