<?php 
/**
 * Template name: Blog
 */
?>
<?php
$wp_query = new WP_Query(array( 'post_type' => 'post',
    'post_status'    => 'publish',
    'posts_per_page' => 3,
    'cat' => 5,
)); ?>
<!-- type: index -->
<?php get_header(); ?>
<div class="container-fluid">
	<div class="container">
		<div class="row">
			<div class="col-xs-12 col-sm-6 col-md-7">
				<div class="row blog-title-1">
					Najpopularniejsze
				</div>
				<div class="row" id="test">
					<!-- Panel 1 -->
					<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
					
					<div class="col-xs-12 col-sm-9 col-md-3 blog-block2">
						<div class="row blog-block2-img" style=" background:url(<?php echo get_the_post_thumbnail_url(); ?>) no-repeat top center; background-size:cover;">

						</div>
						<div class="row blog-block2-title">
							<a href="<?php the_permalink()?>"><?php the_title() ?></a>
						</div>
						<div class="row blog-exc1 hidden-xs hidden-sm hidden-md hidden-lg"><?php the_excerpt(); ?></div>
					</div>
				
				<?php endwhile; ?>
					<?php endif; ?>
					<?php wp_reset_query(); ?>
					<!-- / Panel -->
					

				</div>
			</div>
			<?php
				$wp_query = new WP_Query(array( 'post_type' => 'post',
   					 'post_status'    => 'publish',
   				 'posts_per_page' => 4,
   				   'cat' => 6,
				)); ?>
			<div class="col-xs-12 col-sm-6 col-md-5">
				<div class="row blog-title-2">
					Wybrane przez skilltest
				</div>
				<div class="row" id="Wybrane">
					<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
					<!-- Panel 1 -->
					<div class="col-xs-12 col-sm-5 col-md-5 blog-block3">
						<div class="row blog-block2-img" style=" background:url(<?php echo get_the_post_thumbnail_url(); ?>) no-repeat top center; background-size:cover;">

						</div>
						<div class="row blog-block2-title">
							<a href="<?php the_permalink()?>"><?php the_title() ?></a>
						</div>
					</div>
				<?php endwhile; ?>
					<?php endif; ?>
					<?php wp_reset_query(); ?>
					
				</div>
			</div>
		</div>
	</div>
</div>

<?php
$wp_query = new WP_Query(array( 'post_type' => 'post',
    'post_status'    => 'publish',
    'posts_per_page' => 6,
)); ?>
<div class="container-fluid blog-bg spacer-blog">
	<div class="container">
		<div class="row blog-title">
			Najnowsze 
		</div>
		
		<div class="row ">
			<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
			<div class="col-xs-12 col-sm-6 col-md-4 blog-block ">
				<div class="row blog-block-img" style=" background:url(<?php echo get_the_post_thumbnail_url(); ?>) no-repeat top center; background-size:cover;">
				</div>
				<div class="row block-spac">
					<div class="col-md-7 blog-block-title">
						<?php the_author(); ?>
					</div>
					<div class="col-md-5 blog-date">
						<?php echo get_the_date(); ?>
					</div>
				</div>
				<div class="row blog-b-tit">
					<div class="col-md-12">
						<a href="<?php the_permalink()?>"><?php the_title() ?></a>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12 blog-excerpt">
						<?php the_excerpt(); ?>
					</div>
				</div>
			</div>

					   <?php endwhile; ?>
			
				      <?php else: ?>
		
     					 <?php endif; ?>
		</div>

	</div>
</div>

<script>
jQuery(document).ready(function(){

/* wyróżnienie wpisu najpopularnijeszego */
var bock = $( "#test .blog-block2:nth-child(2)" );
var bock3 = $( "#test .blog-block2:nth-child(3)" );
var author = "<div class='row blog-block-title3'>" + '<?php the_author(); ?>' +"</div>";
var exce = "<div class='row blog-exc1'>" + '<?php the_author(); ?>' +"</div>";
if (screen.width > 991) {
  bock.addClass("most-pop");

   $(author).insertAfter(bock.find(".blog-block2-img"));
   //$(exce).insertAfter(bock.find(".blog-block2-title"));
   bock.find(".blog-block2-title").addClass("block2-bord");
   bock3.addClass("bock3");
   bock.find(".blog-exc1").removeClass("hidden-md hidden-lg");
   bock.find(".blog-block2-img").addClass("blog-img-cust");


  
}
if (screen.width <= 991) {
	bock3.addClass("hidden-sm hidden-md hidden-lg");

	}



}); 




</script>





















<?php get_footer(); ?>