correct banners evets

This commit is contained in:
arlemp@selectel.ru
2022-02-17 18:31:07 +03:00
parent 3a750baf72
commit 108223c5df
4 changed files with 36 additions and 46 deletions

View File

@@ -18,16 +18,18 @@ if (file_exists($votes_file)){
<?
$category = get_queried_object();
$category = get_queried_object();
$current_cat_id = $category->term_id;
$part_args = [
'category__in' => $current_cat_id,
'posts_per_page' => 15,
'posts_per_page' => 22
];
$part_query = new WP_Query( $part_args );
?>
<div id="content">
@@ -40,62 +42,48 @@ $part_query = new WP_Query( $part_args );
<h1 class="my-4"><?=single_cat_title()?></h1>
<?php if($part_query->have_posts()) :?>
<div class="search-card-box">
<?php while($part_query->have_posts()) : the_post();?>
<?$curr_id = get_the_id();?>
<?if ($curr_id > 0):?>
<? if($part_query->have_posts()) :?>
<div class="search-card">
<!--<div class="search-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></div>-->
<div class="search-card-title"><a href="<?the_permalink();?>"><strong><?the_title();?></strong></a></div>
<?if ( has_post_thumbnail() ) :?>
<a href="<?the_permalink();?>">
<img class="search-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" width="180" alt="<?the_title();?>">
</a>
<?endif?>
<?while( $part_query->have_posts() ) :
$part_query->the_post();?>
<?if (isset($_COOKIE["vec_$curr_id"])):?>
<p>Спасибо за Ваш голос</p>
<?endif?>
<div class="search-card">
<!--
<div id="count-<?=$ID?>" style="margin-top: 12px;">
<i class="far fa-thumbs-up"></i> <?=$votes->$curr_id?>
</div> -->
<div class="search-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></div>
<?if ( has_post_thumbnail() ) :?>
<a href="<?the_permalink();?>">
<img class="search-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" width="180" alt="<?the_title();?>">
</a>
<?endif?>
<?if (isset($_COOKIE["vec_$curr_id"])):?>
<p>Спасибо за Ваш голос</p>
<?endif?>
<!--
<div id="count-<?=$ID?>" style="margin-top: 12px;">
<i class="far fa-thumbs-up"></i> <?=$votes->$curr_id?>
</div> -->
<div class="mini-card-body">
<div class="news_date"></div>
<div class="mini-card-body">
<div class="news_date"></div>
</div>
</div>
<?endwhile;?>
</div>
<?endif?>
<?php endwhile;?>
</div>
<?endif?>
<?$GLOBALS['wp_query']->max_num_pages = $part_query->max_num_pages?>
<?get_template_part( '/blocks/paginator');?>
<?wp_reset_postdata();?>
<?else:?>
Здесь пока нет публикаций
<?php endif;?>
</div>