<?php
/**
 * Template part for displaying posts in loop
 *
 * @package Case-Themes
 */
    $post_navigation = solarva()->get_theme_opt( 'post_navigation', false );
    $post_author = solarva()->get_theme_opt( 'post_author', false );
    $post_social_share = solarva()->get_theme_opt( 'post_social_share', false );
    // $tags_list = get_the_tag_list();
    $sg_post_title = solarva()->get_theme_opt('sg_post_title', 'default');
    $sg_featured_img_size = solarva()->get_theme_opt('sg_featured_img_size', '860x538');
    $post_video_link = get_post_meta(get_the_ID(), 'post_video_link', true);

    $thumbnail_featured = null;
    if(has_post_thumbnail()) {
        $img  = pxl_get_image_by_size( array(
            'attach_id'  => get_post_thumbnail_id($post->ID),
            'thumb_size' => $sg_featured_img_size,
        ) );
        $thumbnail_featured = $img['thumbnail'];
    }
?>
<article id="pxl-post-<?php the_ID(); ?>" <?php post_class('pxl---post pxl-post--details'); ?>>
    <?php if(is_singular('post') && $sg_post_title == 'custom_text') : ?>
        <h2 class="pxl-post--title">
            <span class="pxl-title--text"><?php the_title(); ?></span>
        </h2>
    <?php endif; ?>
    <?php solarva()->blog->get_post_metas(); ?>
    <?php if(!is_null($thumbnail_featured)) : ?>
        <div class="pxl-post--featured">
            <?php echo wp_kses_post($thumbnail_featured); ?>     
        </div>
    <?php endif; ?>

    <div class="pxl-post--content clearfix">
        <?php
            the_content();
            wp_link_pages( array(
                'before'      => '<div class="page-links">',
                'after'       => '</div>',
                'link_before' => '<span>',
                'link_after'  => '</span>',
            ) );
        ?>
    </div>

    <?php if($post_social_share ) :  ?>
        <div class="pxl-post--footer">
            <?php if($post_social_share) { solarva()->blog->get_socials_share(); } ?>
            <?php if($post_author) { solarva()->blog->get_author_info(); } ?>
        </div>
    <?php endif; ?>
</article>