<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 */

get_header();
?>
<div class="ct-main-body">
<?php
    if( is_front_page() ) :
        get_template_part( 'template-parts/home/ct', 'slider' );
        get_template_part( 'template-parts/home/ct', 'introduction' );
        get_template_part( 'template-parts/home/ct', 'services' );
        get_template_part( 'template-parts/home/ct', 'team-members' );
        get_template_part( 'template-parts/home/ct', 'features' );
        get_template_part( 'template-parts/home/ct', 'testimonials' );
        get_template_part( 'template-parts/home/ct', 'editor' );

    else :
?>
    <?php if ( has_post_thumbnail() ): ?>
        <div class="container featured-display">
            <div class="row">
                <div class="twelve columns">
                    <?php
                        if ( have_posts() ) {

                            // Load posts loop.
                            while ( have_posts() ) {
                                the_post();
                    ?>
                        <div class="thumbnail-area">
                            <?php the_post_thumbnail( 'prime-business-1200-16x9' ) ?>
                        </div><!-- /.image-container -->
                    <?php
                            }
                        }
                    ?>
                </div><!-- /.twelve columns -->
            </div><!-- /.row -->
        </div><!-- /.container -->
        <?php endif; ?>

        <?php
            $prime_business_cols = 'nine';
            if ( !is_active_sidebar( 'prime-business-page-sidebar' ) ) {
                $prime_business_cols = 'twelve';
            }
        ?>

        <div class="container post-body">
            <div class="row">
                <div class="<?php echo esc_attr( $prime_business_cols ); ?> columns">
                    <?php
                        if ( have_posts() ) {

                            // Load posts loop.
                            while ( have_posts() ) {
                                the_post();
                                get_template_part( 'template-parts/content/content', 'page' );

                                // If comments are open or we have at least one comment, load up the comment template.
                                if ( comments_open() || get_comments_number() ) :
                                    comments_template();
                                endif;
                            }

                        } else {

                            // If no content, include the "No posts found" template.
                            get_template_part( 'template-parts/content/content', 'none' );

                        }
                    ?>
                </div><!-- /.nine columns -->
                <?php get_sidebar(); ?>
            </div><!-- /.row -->
        </div><!-- /.container -->
    <?php endif; ?>
    </div><!-- /.ct-main-body -->
<?php
get_footer();
