<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

global $campoal_options;

$related                = isset($campoal_options['conikal_related_field']) ? $campoal_options['conikal_related_field'] : 0;
$share_button_position  = isset($campoal_options['conikal_post_share_button_position_field']) ? $campoal_options['conikal_post_share_button_position_field'] : 'bottom';
$post_comment           = isset($campoal_options['conikal_post_comment_field']) ? $campoal_options['conikal_post_comment_field'] : 1;

$id                 = get_the_ID();

// get post thumbnail
$thumbnail 			= conikal_get_post_thumbnail($id, (wp_is_mobile() ? 'large' : 'full'), false);
$thumbnail_retina 	= conikal_get_post_thumbnail($id, (wp_is_mobile() ? 'large' : 'full'), false); ?>

<?php while(have_posts()) : the_post();  ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('single-post-simple'); ?>>
    <div class="wrapper read">
        <div class="ui container">
            
            <div class="ui relaxed centered grid">
                <div class="sixteen wide mobile sixteen wide tablet eleven wide computer center aligned column">
                    <div class="post-simple-title">
                        <header class="entry-header">
                            <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
                        </header><!-- .entry-header -->

                        <div class="post-subheader-section ui small header">
                            <?php get_template_part('templates/content/part/post-subtitle-action'); ?>
                        </div>

                        <?php if ( in_array($share_button_position, array('all', 'header')) ) {
                            echo conikal_social_button_after_post_content('', 'none');
                        } ?>
                    </div>
                </div>
            </div>

            <?php if (has_post_thumbnail()) : ?>
                <div class="feature-image lazy" data-src="<?php echo esc_url($thumbnail) ?>" data-retina="<?php echo esc_url($thumbnail_retina) ?>"></div>
            <?php endif; ?>

            <div class="ui relaxed centered grid">
                <div class="sixteen wide mobile sixteen wide tablet eleven wide computer column post-content-sidebar" id="content">
                    
                <?php get_template_part('templates/content/part/post-category-labels'); ?>

                <?php
                    // Include the single post content template.
                    get_template_part( 'templates/content/single-content', 'post' );
                ?>
                </div>
            </div>

        </div>
    </div>
    <div class="clearfix"></div>

    <div class="ui container post-addition-section">
        <div class="ui hidden divider"></div>
        <?php if($related == 1) { ?>
                <?php get_template_part('templates/related-posts'); ?>
        <?php } ?>
        <?php if(comments_open() && $post_comment == 1) { ?>
        <div class="post-comment-section">
            <div class="ui centered grid">
                <div class="sixteen wide mobile sixteen wide tablet eleven wide computer column">
                    <?php comments_template(); ?>
                </div>
            </div>
        </div>
        <?php } ?>
        <?php if (function_exists('conikal_ads_banner')) {
            conikal_ads_banner('conikal_single_post_banner_4_field');
        } ?>
    </div>
</article>
<?php endwhile; ?>
