<?php 

/**
 * @package WordPress
 * @subpackage Campoal
 */

global $campoal_options;
global $post;

get_header();

$sidebar_position = isset($campoal_options['conikal_sidebar_field']) ? $campoal_options['conikal_sidebar_field'] : 'right';
$show_bc = isset($campoal_options['conikal_breadcrumbs_field']) ? $campoal_options['conikal_breadcrumbs_field'] : 0;
$blog_layout = isset($campoal_options['conikal_blog_layout_field']) ? $campoal_options['conikal_blog_layout_field'] : 'list';

$blog_main_col = 'eleven';
if ($blog_layout == 'grid') {
    $blog_main_col = 'sixteen';
}
?>

<?php
    // get blog featured posts
    get_template_part('templates/header/blog-featured');
?>
<div id="wrapper">
    <div class="ui container">
        <div class="page content">
            <?php if($show_bc == 1) {
                conikal_petition_breadcrumbs();
            } else { ?>
                <div class="none-breadcrumb"></div>
            <?php } ?>
            <div class="ui <?php echo esc_attr(!is_active_sidebar('main-widget-area') ? 'centered' : 'relaxed') ?> grid">
                <?php if(is_active_sidebar('main-widget-area') && $sidebar_position == 'left' && $blog_layout != 'grid') { ?>
                <div class="sixteen wide mobile sixteen wide tablet five wide computer column computer only">
                    <?php get_sidebar(); ?>
                </div>
                <?php } ?>
                <div class="sixteen wide moble sixteen tablet <?php echo esc_attr( $blog_main_col ) ?> wide computer column">
                    <?php
                    /*
                     * Loop post content template
                     * If you want to override this in a child theme, then include a file
                     */
                    get_template_part('loop/loop-post', 'content'); ?>
                </div>
                <?php if(is_active_sidebar('main-widget-area') && $sidebar_position == 'right' && $blog_layout != 'grid') { ?>
                <div class="five wide column computer only">
                    <?php get_sidebar(); ?>
                </div>
                <?php } ?>
            </div>
        </div>
    </div>
</div>

<?php get_footer(); ?>