<?php

/*
 * Template Name: News Update Page
 * @package WordPress
 */

get_header(); ?>
<div class='container-fluid'>
	<div class='row'>
		<?php if (has_post_thumbnail()){
			the_post_thumbnail('full',array('class'=>'img-responsive full-width'));
		}?>
	</div>
</div>
<div class='container'>
	<div class='row'>
		<div class='col-xs-12 col-sm-12 col-md-9 page-wrap'>
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <main id="main" class="site-main" role="main">
				<?php
				while ( have_posts() ) : the_post();
				get_template_part( 'template-parts/content', 'page' );
				if ( comments_open() || get_comments_number() ) {
					comments_template();
				}
				endwhile;
				wp_reset_postdata();?>
                
				<?php
                
                global $post;
                $args = array( 
					'posts_per_page' => 5,  
					'post_type' => 'news', 
					);
                
                $myposts = get_posts( $args );
                foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 news-item">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding">
                        	<?php if (has_post_thumbnail()){
								the_post_thumbnail('full',array('class'=>'img-responsive full-width'));
							}?>
                            <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                            <p><a class="blue-btn" href="<?php the_permalink(); ?>">Read More</a></p>
                            
                        </div>
                    </div>
                <?php endforeach; 
                wp_reset_postdata();?>
                
                
			</main><!-- .site-main -->
			<?php get_sidebar( 'content-bottom' ); ?>
            </div>
		</div>
		<div class='col-xs-12 col-sm-12 col-md-3 page-sidebar'>
			<?php get_sidebar(); ?>
		</div>
	</div>
</div>

<?php get_footer(); ?>