Files
vij/index.php

92 lines
2.0 KiB
PHP
Raw Normal View History

2021-09-16 12:14:35 +03:00
<?php
/**
* The main template file.
*
*/
2021-09-20 01:07:53 +03:00
get_header();
$nn = 0;?>
2021-09-16 12:14:35 +03:00
2021-10-11 22:29:11 +03:00
<div id="content">
<h1 id="mainpage-title">Главное</h1>
<?include(get_template_directory().'/blocks/mainnews.php');?>
2021-09-18 01:30:09 +03:00
<?php $query = new WP_Query(
2021-09-24 23:18:38 +03:00
array(
2021-10-09 22:59:32 +03:00
'category__in' => array(2),
2021-10-11 22:29:11 +03:00
'post__not_in' => array($mainpost_id),
2021-09-24 23:18:38 +03:00
'meta_query' => array(
array(
'key' => '_thumbnail_id',
//'compare' => 'EXISTS'
)
)
)
); # фильтруем рубрики
2021-09-18 01:30:09 +03:00
?>
2021-10-11 22:29:11 +03:00
<?php if($query->have_posts()) : ?>
2021-09-18 01:30:09 +03:00
2021-10-11 22:29:11 +03:00
<div class="mini-card-block">
2021-09-18 01:30:09 +03:00
2021-10-11 22:29:11 +03:00
<?php while($query->have_posts()) : $query->the_post();?>
2021-09-20 01:07:53 +03:00
2021-10-31 13:01:31 +03:00
<?$nn++?>
2021-11-04 10:58:53 +03:00
<?if ($nn == 9){
2021-10-31 13:01:31 +03:00
get_template_part( '/blocks/krasavica');
}
?>
2021-10-11 22:29:11 +03:00
<div class="mini-card">
<?if ( has_post_thumbnail() ) :?>
<div class="mini-card-img">
2021-11-10 21:21:00 +03:00
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
2021-11-01 19:13:59 +03:00
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
2021-10-11 22:29:11 +03:00
</div>
<?endif?>
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="mini-card-body">
<div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>
</div>
2021-09-18 01:30:09 +03:00
<?php endwhile;?>
2021-10-11 22:29:11 +03:00
</div>
2021-09-20 01:07:53 +03:00
2021-09-18 01:30:09 +03:00
2021-09-27 00:07:02 +03:00
2021-10-31 13:01:31 +03:00
2021-09-18 01:30:09 +03:00
<?php endif;?>
2021-09-27 00:07:02 +03:00
<?php wp_reset_postdata();?>
2021-11-01 02:22:21 +03:00
<div class="publ-to-main">
<button class="more_button" onclick="location.href='<?=get_category_link(2)?>/page/2'" type="button">
Показать ещe</button>
</div>
2021-09-28 22:25:21 +03:00
<?get_template_part( '/blocks/opinion', null, ['subclass' => 'mob-lite']);?>
2021-11-10 21:21:00 +03:00
<?//get_template_part( '/blocks/citata', null, ['subclass' => 'mob-lite']);?>
2021-09-28 22:25:21 +03:00
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
2021-09-27 00:07:02 +03:00
2021-10-11 22:29:11 +03:00
2021-09-18 01:30:09 +03:00
2021-09-20 01:07:53 +03:00
</div> <!-- end content -->
2021-09-16 12:14:35 +03:00
2021-09-27 00:07:02 +03:00
<?php get_footer(); ?>