Files
vij/index.php

88 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-09-18 01:30:09 +03:00
<?php $query = new WP_Query(
2021-09-24 23:18:38 +03:00
array(
'category__not_in' => array(2, 15, 18 ,44, 1028),
'meta_query' => array(
array(
'key' => '_thumbnail_id',
//'compare' => 'EXISTS'
)
)
)
); # фильтруем рубрики
2021-09-18 01:30:09 +03:00
?>
<div id="content">
<h1 class="my-4">Главное</h1>
<?php if($query->have_posts()) : while($query->have_posts()) : $query->the_post();?>
2021-09-20 01:07:53 +03:00
<?$nn++;?>
<?if ($nn == 1):?>
2021-09-18 01:30:09 +03:00
2021-09-20 01:07:53 +03:00
<div class="main-card">
2021-09-27 00:07:02 +03:00
<?if ( has_post_thumbnail() ) :?>
<div class="card-img-top">
<a href="<?the_permalink();?>"><img src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
</div>
2021-09-20 01:07:53 +03:00
<?endif?>
<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="main-card-body">
<div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
<div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>
2021-09-18 01:30:09 +03:00
</div>
2021-09-20 01:07:53 +03:00
<?elseif ($nn == 2):?>
<div class="mini-card-block">
<?endif?>
2021-09-18 01:30:09 +03:00
2021-09-20 01:07:53 +03:00
<?if ($nn > 1):?>
<div class="mini-card">
<?if ( has_post_thumbnail() ) :?>
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
<?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>
<?endif?>
2021-09-18 01:30:09 +03:00
<?php endwhile;?>
2021-09-20 01:07:53 +03:00
</div> <!--//end minicard block -->
2021-09-18 01:30:09 +03:00
2021-09-27 00:07:02 +03:00
2021-09-18 01:30:09 +03:00
<?php endif;?>
2021-09-27 00:07:02 +03:00
<?php wp_reset_postdata();?>
<?php mob_block('/blocks/opinion.php');?>
<?php mob_block('/blocks/citata.php');?>
<?php mob_block('/blocks/mosts.php');?>
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(); ?>