<?php
/**
 * Template Name: Alt Home Page Features, no sidebar
 * Description: Alt Home Page Features with no sidebar
 */
// Define page_id
$page_ID = get_the_ID();
 
// Define paginated posts
$page    = get_query_var( 'page' );
 
// Define custom query parameters
$args    = array(
    'post_type'      => 'post',
    'paged'          => ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1
);

if ( is_front_page() )
    $args['paged'] = $page;
	
$the_query = new WP_Query( $args );
	
get_header(); ?>

<?php get_template_part( 'template-parts/slider' ) ;?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">
        	<div class="inner-wrapper">
                <div class="container">
                    <div class="row">
                        <div class="col-md-8">
                            <div class="archived-wrapper">
								<?php
                                if ( $the_query->have_posts() ) :
                       
                                    /* Start the Loop */
                                    while ( $the_query->have_posts() ) : $the_query->the_post();
                        
                                        /*
                                         * Include the Post-Format-specific template for the content.
                                         * If you want to override this in a child theme, then include a file
                                         * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                                         */
                                        get_template_part( 'template-parts/content', get_post_format() );
                        
                                    endwhile;
                                    $pagination_args = array(
                                        'mid_size' => 2,
                                        'prev_text' => '<span class="fa fa-chevron-left"></span>', 
                                        'next_text' => '<span class="fa fa-chevron-right"></span>'
                                    );
                                     
                                    if ( ! is_front_page() && 0 < intval( $page ) )
                                        $pagination_args['base'] = user_trailingslashit(
                                            untrailingslashit( get_page_link( $page_ID ) ) . '/page/%#%'
                                        );

                                    $GLOBALS['wp_query'] = $the_query;
                                    the_posts_pagination( $pagination_args );
                        
                                else :
                        
                                    get_template_part( 'template-parts/content', 'none' );
                        
                                endif;
                                ?>
                                <?php wp_reset_postdata(); ?>
									
                            </div><!--post-wrapper-->
                        </div>
                        <div class="col-md-4">
                            <?php get_sidebar(); ?>
                        </div>
                    </div>
                </div><!-- container -->
            </div>
		</main><!-- #main -->
	</div><!-- #primary -->

<?php
get_footer();
