83 lines
1.9 KiB
PHP
83 lines
1.9 KiB
PHP
<?php
|
||
/**
|
||
* The main template file.
|
||
*
|
||
*/
|
||
|
||
get_header();
|
||
$nn = 0;?>
|
||
|
||
|
||
|
||
|
||
<div id="content">
|
||
|
||
<h1 id="mainpage-title">Главное</h1>
|
||
|
||
<?include(get_template_directory().'/blocks/mainnews.php');?>
|
||
|
||
<?php $query = new WP_Query(
|
||
array(
|
||
'category__in' => array(2),
|
||
'post__not_in' => array($mainpost_id),
|
||
'meta_query' => array(
|
||
array(
|
||
'key' => '_thumbnail_id',
|
||
//'compare' => 'EXISTS'
|
||
)
|
||
)
|
||
)
|
||
); # фильтруем рубрики
|
||
?>
|
||
|
||
<?php if($query->have_posts()) : ?>
|
||
|
||
|
||
<div class="mini-card-block">
|
||
|
||
<?php while($query->have_posts()) : $query->the_post();?>
|
||
|
||
<?$nn++?>
|
||
|
||
<?if ($nn == 2){
|
||
get_template_part( '/blocks/krasavica');
|
||
}
|
||
?>
|
||
|
||
|
||
<div class="mini-card">
|
||
<?if ( has_post_thumbnail() ) :?>
|
||
<div class="mini-card-img">
|
||
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?the_title();?>"></a>
|
||
</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>
|
||
|
||
|
||
<?php endwhile;?>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<?php endif;?>
|
||
|
||
<?php wp_reset_postdata();?>
|
||
|
||
<?get_template_part( '/blocks/opinion', null, ['subclass' => 'mob-lite']);?>
|
||
<?get_template_part( '/blocks/citata', null, ['subclass' => 'mob-lite']);?>
|
||
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
|
||
|
||
<div class="publ-to-main"><a href="<?=get_category_link(2)?>/page/2"><span class="go-to-main">Показать ещe</span></a></div>
|
||
|
||
|
||
</div> <!-- end content -->
|
||
|
||
|
||
<?php get_footer(); ?>
|