<?php
/**
 * @package Bravisthemes
 */
get_header();
$post_title_pos = kaitex()->get_page_opt( 'post_title_pos', 'pcontent' );
$kaitex_sidebar = kaitex()->get_sidebar_args(['type' => 'post', 'content_col_xl'=> '8', 'content_col_lg'=> '12']);

$post_author = kaitex()->get_opt( 'post_author', 'true' );
$post_date = kaitex()->get_opt( 'post_date', 'true' );
$post_time_text = kaitex()->get_opt( 'post_time_text', '' );
$post_author_header_social = kaitex()->get_opt( 'post_author_header_social', 'true' );
?>
<?php if($post_author == 'true' || $post_date == 'true' || !empty($post_time_text) || $post_author_header_social == 'true') : ?>
    <div class="pxl-post--meta">
        <div class="post--item">
            <?php if($post_author == 'true') : ?>
                <?php echo get_avatar($post->post_author, 160, '', ''); ?>
            <?php endif; ?>
            <div class="post--content">
                <?php if($post_author == 'true') : ?>
                    <div class="post--author">
                        <a href="<?php echo get_author_posts_url( get_post_field( 'post_author', get_the_ID() ) ); ?>" title="Posts by <?php echo get_the_author_meta( 'display_name', get_post_field( 'post_author', get_the_ID() ) ); ?>" rel="author">
                            <?php echo get_the_author_meta( 'display_name', get_post_field( 'post_author', get_the_ID() ) ); ?>
                        </a>
                    </div>
                <?php endif; ?>
                <?php if($post_date == 'true' || !empty($post_time_text)) : ?>
                    <div class="post--inner">
                        <?php if($post_date == 'true') : ?>
                            <div class="post--date"><?php echo get_the_date(); ?></div>
                        <?php endif; ?>
                        <?php if(!empty($post_time_text)) : ?>
                            <div class="post--time"><?php echo pxl_print_html($post_time_text); ?></div>
                        <?php endif; ?>
                    </div>
                <?php endif; ?>
            </div>
        </div>
        <?php if($post_author_header_social == 'true') :
            $post_author_social_text_01 = kaitex()->get_opt( 'post_author_social_text_01' );
            $post_author_social_link_01 = kaitex()->get_opt( 'post_author_social_link_01' );
            $post_author_social_text_02 = kaitex()->get_opt( 'post_author_social_text_02' );
            $post_author_social_link_02 = kaitex()->get_opt( 'post_author_social_link_02' );
            $post_author_social_text_03 = kaitex()->get_opt( 'post_author_social_text_03' );
            $post_author_social_link_03 = kaitex()->get_opt( 'post_author_social_link_03' );
            $post_author_social_text_04 = kaitex()->get_opt( 'post_author_social_text_04' );
            $post_author_social_link_04 = kaitex()->get_opt( 'post_author_social_link_04' );
            ?>
            <div class="author--social">
                <?php if(!empty($post_author_social_text_01)) : ?>
                    <a class="item--social" target="_blank" href="<?php echo esc_url($post_author_social_link_01); ?>">
                        <?php echo pxl_print_html($post_author_social_text_01); ?>
                    </a>
                <?php endif; ?>
                <?php if(!empty($post_author_social_text_02)) : ?>
                    <a class="item--social" target="_blank" href="<?php echo esc_url($post_author_social_link_02); ?>">
                        <?php echo pxl_print_html($post_author_social_text_02); ?>
                    </a>
                <?php endif; ?>
                <?php if(!empty($post_author_social_text_03)) : ?>
                    <a class="item--social" target="_blank" href="<?php echo esc_url($post_author_social_link_03); ?>">
                        <?php echo pxl_print_html($post_author_social_text_03); ?>
                    </a>
                <?php endif; ?>
                <?php if(!empty($post_author_social_text_04)) : ?>
                    <a class="item--social" target="_blank" href="<?php echo esc_url($post_author_social_link_04); ?>">
                        <?php echo pxl_print_html($post_author_social_text_04); ?>
                    </a>
                <?php endif; ?>
            </div>
        <?php endif; ?>
    </div>
<?php endif; ?>
<div class="container">
    <div class="row <?php echo esc_attr($kaitex_sidebar['wrap_class']) ?>">
        <?php if($post_title_pos == 'ptitle') : ?>
            <div class="pxl-title-area">
                <?php kaitex()->blog->get_post_header(); ?>
            </div>
        <?php endif; ?>
        <div id="pxl-content-area" class="<?php echo esc_attr($kaitex_sidebar['content_class']) ?>">
            <main id="pxl-content-main">
                <?php while ( have_posts() ) {
                    the_post();
                    get_template_part( 'template-parts/content/content-single', get_post_format() );
                } ?>
            </main>
        </div>
        <?php if ($kaitex_sidebar['sidebar_class']) : ?>
            <div id="pxl-sidebar-area" class="<?php echo esc_attr($kaitex_sidebar['sidebar_class']) ?>">
                <div class="pxl-sidebar-sticky">
                    <?php get_sidebar(); ?>
                </div>
            </div>
        <?php endif; ?>
    </div>
</div>

<?php get_footer();
