Files
vij/index.php
arlemp@selectel.ru 4ef8026dc6 correct page number
2021-12-24 18:40:40 +03:00

82 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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++?>
<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(); ?>" alt="<?the_title();?>"></a>
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
</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();?>
<div class="publ-to-main">
<button class="more_button" onclick="location.href='<?=get_category_link(2)?>/page/2'" type="button">
Показать ещe</button>
</div>
<?get_template_part( '/blocks/opinion', null, ['subclass' => 'mob-lite']);?>
<?get_template_part( '/blocks/citats', null, ['subclass' => 'mob-lite']);?>
</div> <!-- end content -->
<?php get_footer(); ?>