<?php
/**
 * Front page template.
 *
 * @package express-movers
 */

get_header();

if ( is_front_page() && is_home() ) {
	?>
    <main id="primary" class="site-main front">
        <!-- <div class="banner-head">
            <div class="center-div">
                <h1></?php esc_html_e('Posts', 'express-movers'); ?></h1>
            </div>
        </div> -->
        <div class="blog-div container p-2 mt-3" id="primaryid">
            <div class="row">
                <div class="col-lg-8 col-md-8 col-12 front-post">
                    <?php
                    if (have_posts()):

                        if (is_home() && !is_front_page()):
                            ?>
                            <header>
                                <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
                            </header>
                            <?php
                        endif; ?>
                        <div class="row mainrow">
                            <?php
                            while (have_posts()):
                                the_post();
                                ?>

                                <div class="col-lg-6 col-md-6 col-12 box gap-10 mb-3">
                                    <?php get_template_part( 'template-parts/content', get_post_type() ); ?>
                                </div>

                                <?php

                            endwhile;
                            the_posts_pagination(array(
                                'mid_size' => __('2', 'express-movers'),
                                'prev_text' => __('« Previous', 'express-movers'),
                                'next_text' => __('Next »', 'express-movers'),
                            ));

                    else:

                        get_template_part('template-parts/content', 'none');

                    endif;
                    ?>
                    </div>
                </div>
                <div class="col-lg-4 col-md-4 col-12 sidebar-col ">
                    <div class="sidebar-div mx-3">
                        <?php
                        if ( is_active_sidebar( 'sidebar-1' ) ) {
                            ?>
                            <aside id="secondary" class="widget-area sidebar">
                                <?php dynamic_sidebar( 'sidebar-1' ); ?>
                            </aside>
                            <?php
                        } else {
                            get_sidebar();
                        }
                        ?>
                    </div>
                </div>
            </div>


        </div>
    </main>

	<?php
} elseif ( is_front_page() && ! is_home() ) {
	?>
    <main id="primary" class="site-main">
        <?php
        get_template_part('template-parts/section/section', 'featured-slider');
        
        get_template_part('template-parts/section/section', 'featured-about');

        get_template_part( 'template-parts/section/section', 'featured-services' );

        get_template_part( 'template-parts/section/section', 'recent-posts' );

        ?>
    </main><!-- #main -->
	<?php
}

get_footer();