<?
$current_page = (get_query_var('paged')) ? get_query_var('paged') : 1;
$params = array(
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 10, // количество постов на странице
'post_type' => 'news', // тип постов
'paged' => $current_page // текущая страница
);
query_posts($params);
$wp_query->is_archive = true;
$wp_query->is_home = false;
while(have_posts()): the_post();
?>
<? if ($count == 0) { ?>
<div class="col-8">
<a href="<?php echo the_permalink(); ?>">
<div class="post_head-news d-flex align-items-end" style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
<div class="post_head-background flex-column">
<div class="post_head-content-wrap">
<div class="post-head_title col-12"><?php the_title(); ?></div>
<div class="post-head_date col-12"><img src="<? echo get_template_directory_uri(); ?>/assets/svg/clock.svg" alt=""><?php echo get_the_date('j F Y'); ?></div>
</div>
</div>
</div>
</a>
</div>
<div class="col-4">
<!-- Календарь -->
</div>
<? } elseif ($count >= 1 && $count <= 3) { ?>
<div class="col-md-4 col-12 mb-3 mt-4">
<a href="<?php echo the_permalink(); ?>">
<div class="post_head-news d-flex align-items-end" style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
<div class="post_head-background flex-column">
<div class="post_head-content-wrap">
<div class="post-head_title col-12"><?php the_title(); ?></div>
<div class="post-head_date col-12"><img src="<? echo get_template_directory_uri(); ?>/assets/svg/clock.svg" alt=""><?php echo get_the_date('j F Y'); ?></div>
</div>
</div>
</div>
</a>
</div>
<?} elseif ($count > 3) {?>
<div class="col-lg-4 col-sm-6 col-12">
<a href="<?php echo the_permalink(); ?>">
<div class="post row">
<div class="post_img post_img-news col-6 col-lg-6 col-xl-5 col-md-6 col-sm-7 w-25">
<img src="<?php echo get_the_post_thumbnail_url();?>" alt="">
</div>
<div class="col-6 col-lg-6 col-xl-7 col-md-6 col-sm-5 row pl-0">
<div class="post_title col-12"><?php the_title(); ?></div>
<div class="post_date-wrap d-flex align-items-end col-12">
<div class="post_date">
<img src="<? echo get_template_directory_uri(); ?>/assets/svg/clock-blue.svg" alt=""><?php echo get_the_date('j F Y'); ?>
</div>
</div>
</div>
</div>
</a>
</div>
<?}?>
<?$count++;
endwhile;
?>