<?php if ( have_posts() ) { 
    while ( have_posts() ) {
        the_post(); 
        $featured_content = get_post_meta(get_the_ID(),'single_post_featured_content',true);
        $post_format = get_post_format();
        ?>
        <div <?php post_class('kopa-entry-post'); ?> id="post-<?php echo get_the_ID(); ?>">
            <article class="entry-item">
                <?php if ( has_post_thumbnail() ) : ?>
                <div class="entry-thumb">
                    <?php get_template_part( 'library/templates/post-featured-content/content'); ?>
                </div><!-- end thumbnail -->
                <?php endif;?>

                <?php if(get_theme_mod('post_date_status', 1) || get_theme_mod('post_comment_number_status', 1) || get_theme_mod('post_category_status', 1)){ ?>
                <div class="entry-meta">
                    <?php if(get_theme_mod('post_date_status', 1)){ ?>
                        <span class="entry-date"><?php echo get_the_date('F j,Y'); ?></span>
                    <?php } ?>
                    <?php if(get_theme_mod('post_comment_number_status', 1)){ ?>
                    <?php if(comments_open() && !post_password_required()){ ?>
                        <span class="entry-comment"> / <?php comments_popup_link(__('No comment', 'garajez-lite'), '1 '.__('comment', 'garajez-lite'), '% '. esc_attr__('comments', 'garajez-lite')); ?></span>
                    <?php } ?>
                    <?php } ?>
                    <?php if(get_theme_mod('post_category_status', 1)){ ?>
                        <span class="entry-categories"> / <?php echo esc_html__('in:','garajez-lite'); ?> <?php the_category(', '); ?></span>
                    <?php } ?>
                </div>  
                <?php } ?>
                <?php if(get_theme_mod('post_title_status', 1)){
                    ?>
                    <h1 class="entry-title" id="kopa-post-title"><?php the_title(); ?></h1>
                    <?php
                } ?>
                <div id="kopa-post-content">
                    <?php  the_content(); ?>
                </div>
            </article>

            <?php
                wp_link_pages(array(
                    'before' => '<div class="page-links">',
                    'after' => '</div>',
                ));

                #NEXT PREVIOUS PAGINATION
                get_template_part('library/templates/post/pagination');

                #TAGS
                if ( 1 == get_theme_mod('post_tag_status', 1) ) {
                    the_tags('<div class="kopa-tag-box"><span>'. esc_attr__( 'Tags: ', 'garajez-lite' ) . '</span>',', ','</div>');
                }

                #AUTHOR
                if ( 1 == get_theme_mod('post_author_status', 1) ) {
                $post_author_name = get_the_author_meta('display_name');
                $post_author_des = get_the_author_meta('description');
                echo '<div class="kopa-author clearfix" itemscope itemtype="http://data-vocabulary.org/Person">';
                    echo '<a class="avatar-thumb" href="' . esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) )) . '">' . get_avatar( get_the_author_meta( 'ID' ), 91 ) . '</a>';
                    echo '<div class="author-content">';
                        if ( !empty($post_author_name) ) {
                            echo '<h4 class="author-name">' . esc_attr__('About the author: ', 'garajez-lite') . '<a href="' . esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) )) . '">' . esc_html($post_author_name) . '</a></h4>';
                        }
                        if ( !empty($post_author_des) ) {
                            echo '<p>' . esc_html($post_author_des) . '</p>';
                        }
                    echo '</div>';
                echo '</div>';
            }

                #RELATED POST
                get_template_part('library/templates/post/related-posts');

                comments_template();
            ?>
        </div><!-- kopa-single-post -->
        <?php
    } // endwhile
} // endif
