Files
vij/category-5121.php

92 lines
1.9 KiB
PHP
Raw Normal View History

2022-02-17 12:36:51 +03:00
<?php
/**
* The main template file.
*
*/
2022-02-17 23:55:41 +03:00
2022-02-17 12:36:51 +03:00
get_header();
$nn = 0;
$ids = [];
$votes_file = '/vhosts/beta/wp-content/themes/vij/golos.json';
if (file_exists($votes_file)){
$votes = json_decode(file_get_contents($votes_file, true));
}
?>
<?
2022-02-17 18:31:07 +03:00
$category = get_queried_object();
2022-02-17 12:36:51 +03:00
$current_cat_id = $category->term_id;
$part_args = [
'category__in' => $current_cat_id,
2022-02-17 23:59:00 +03:00
'posts_per_page' => 23,
2022-02-17 23:55:41 +03:00
'paged' => $paged
2022-02-17 18:31:07 +03:00
2022-02-17 12:36:51 +03:00
];
$part_query = new WP_Query( $part_args );
2022-02-17 18:31:07 +03:00
2022-02-17 12:36:51 +03:00
?>
<div id="content">
<ul id="nav_content">
<li><a href="https://vetandlife.ru">Главная</li>
<li> - <?single_cat_title()?></li>
</ul>
<h1 class="my-4"><?=single_cat_title()?></h1>
2022-02-17 18:31:07 +03:00
<? if($part_query->have_posts()) :?>
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
<?while( $part_query->have_posts() ) :
$part_query->the_post();?>
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
<div class="search-card">
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
<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> -->
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
<div class="mini-card-body">
<div class="news_date"></div>
</div>
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
</div>
<?endwhile;?>
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
<?endif?>
2022-02-17 12:36:51 +03:00
2022-02-17 18:31:07 +03:00
<?$GLOBALS['wp_query']->max_num_pages = $part_query->max_num_pages?>
2022-02-17 12:36:51 +03:00
<?get_template_part( '/blocks/paginator');?>
2022-02-17 18:31:07 +03:00
<?wp_reset_postdata();?>
2022-02-17 12:36:51 +03:00
</div>
<?php get_footer(); ?>