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

global $campoal_options;

$sidebar_position   = isset($campoal_options['conikal_sidebar_field']) ? $campoal_options['conikal_sidebar_field'] : 'right';
$related            = isset($campoal_options['conikal_related_field']) ? $campoal_options['conikal_related_field'] : 1;
$post_comment       = isset($campoal_options['conikal_post_comment_field']) ? $campoal_options['conikal_post_comment_field'] : 1;
?>

<?php while(have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('wrapper read post'); ?>>
    <div class="ui container">
        <div class="ui relaxed grid">
            <?php if(is_active_sidebar('main-widget-area') && $sidebar_position == 'left') { ?>
                <div class="sixteen wide mobile sixteen wide tablet five wide computer column computer only post-left-widget-sidebar" id="post-left-widget-sidebar">
                    <?php get_sidebar(); ?>
                </div>
            <?php } ?>
            <div class="sixteen wide mobile sixteen wide tablet <?php echo esc_attr(is_active_sidebar('main-widget-area') ? 'eleven' : 'sixteen') ?> wide computer column post-content-sidebar" id="content">
                <?php

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

                <div class="post-addition-section">
                    <?php if($related == 1) { ?>
                        <?php get_template_part('templates/related-posts'); ?>
                    <?php } ?>

                    <?php if(comments_open() && $post_comment == 1) { ?>
                        <div class="post-comment-section">
                            <?php comments_template(); ?>
                        </div>
                    <?php } ?>
                </div>
            </div>
            <?php if(is_active_sidebar('main-widget-area') && $sidebar_position == 'right') { ?>
                <div class="five wide column computer only post-right-widget-sidebar" id="post-right-widget-sidebar">
                    <?php get_sidebar(); ?>
                </div>
            <?php } ?>
        </div>

        <?php if (function_exists('conikal_ads_banner')) { 
            conikal_ads_banner('conikal_single_post_banner_4_field');
        } ?>
    </div>
</article>
<?php endwhile; ?>