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

global $campoal_options;
global $post;

$blog_layout = isset($campoal_options['conikal_blog_layout_field']) ? $campoal_options['conikal_blog_layout_field'] : 'list';

if ( have_posts() ) : 
    if ($blog_layout == 'grid') : ?>
        <div class="ui <?php echo esc_attr(is_author() || is_date() || is_category() || is_tag() ? 'two' : 'three') ?> stackable cards petition-cards" id="content">
    <?php endif;
    while ( have_posts() ) : the_post(); ?>

        <?php
        /*
         * Include the Post-Format-specific template for the content.
         * If you want to override this in a child theme, then include a file
         */
        get_template_part('loop/content-post', $blog_layout);

    // End the loop.
    endwhile; 

    if ($blog_layout == 'grid') : ?>
        </div>
    <?php endif; ?>

    <!-- PAGINATION -->
    <div class="pagination">
        <div class="ui center aligned basic segment">
            <?php conikal_pagination(); ?>
        </div>
    </div>
<?php else :
    // display not found post notice
    conikal_not_found_post(__('No posts found.', 'campoal'), __("We're sorry, but no posts matched your criteria.", 'campoal'));
endif; ?>