<?php
/*
Template Name: Blog  
*/
get_header();
global $webh_data;
global $post;
get_template_part('include/section-slider');
?>
<div class="blog-wrapper">
            <div class="container">
                <div class="row">
                    <div class="col-sm-9">
				<?php
				$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
				$args = array( 'post_type' => 'post',  'paged' => $paged );  
				query_posts($args);
				if (have_posts()) :
				while ( have_posts() ) : the_post();  
				$comments_count = wp_count_comments($post->ID);
				$thumb_w = '848';
				$thumb_h = '389';
				echo '<article class="article clearfix">'; ?>
				<ul class="list-n"><?php
					webhosty_posted_on(); 
					echo '<li class="avtor">'.esc_attr(get_the_author()).'</li> 
					<li class="b">'.esc_attr($comments_count->approved).'</li>
				</ul>';
				if (has_post_thumbnail($post->ID))
				{
					$thumb = get_post_thumbnail_id($post->ID);
					$attachment_url = wp_get_attachment_url($thumb, 'full');
					$image = aq_resize($attachment_url, $thumb_w, $thumb_h, true);
					echo '<a class="post-img" href="'.esc_url(get_permalink()).'">
					<img src="'.esc_url( $image).'" alt="post-img">
					</a>';  
				}							
				echo'<div class="post-content clearfix">
					<h2 class="post-title">';
					echo' <a href="'.esc_url( get_permalink($post->ID) ).'">'.esc_attr(get_the_title($post->ID)).'</a>
					</h2>
					<p class="post-text">'.esc_attr(get_excerpt(200)).'</p>
					<a class="button btn-learn" href="'.esc_url( get_permalink($post->ID) ).'">'.__('learn more','webhosty').'</a>
				</div>
			</article>'; 
			endwhile; 
			webhosty_paging_nav();
			endif;  
			   wp_reset_query(); ?> 
                      </div>
					  
                   <?php webhosty_sidebar();?> 
                </div> 
            </div>
        </div>
<?php get_footer(); ?>