add old ver tag

This commit is contained in:
argoexpert press
2025-06-20 11:33:50 +03:00
parent cbe6f0b3c4
commit 349dfe7bc6
3 changed files with 14 additions and 39 deletions

View File

@@ -15,7 +15,6 @@ $title = isset($args['title']) ? $args['title'] : 'РФО';
$style = isset($args['style']) ? $args['style'] : 0; $style = isset($args['style']) ? $args['style'] : 0;
$posts_count = isset($args['posts_count']) ? $args['posts_count'] : 1; $posts_count = isset($args['posts_count']) ? $args['posts_count'] : 1;
?> ?>
<pre><?=$category?></pre>
<div class="custom-category-block" data-category="<?php echo esc_attr($category); ?>"> <div class="custom-category-block" data-category="<?php echo esc_attr($category); ?>">
<?php <?php
$query_args = array( $query_args = array(

18
tag.php
View File

@@ -1,9 +1,9 @@
<?php get_header(); ?> <?php get_header(); ?>
<div class="content-middle articles-wrapper"> <div class="content-middle articles-wrapper">
<?php //get_template_part('partials/rubrics-mobile'); ?> <?php get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title desktop"> <div class="section-title desktop">
<?php if (is_tag()) : ?> <?php if (is_tag()) : ?>
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1> <h1 class="section-title__title"><?= single_tag_title('', false) ?></h1>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="articles-preview"> <div class="articles-preview">
@@ -13,11 +13,21 @@
'post_type' => 'post', 'post_type' => 'post',
'posts_per_page' => 13, 'posts_per_page' => 13,
'paged' => $paged, 'paged' => $paged,
'tag_id' => get_queried_object_id() // Изменили category__in на tag_id 'tag_id' => get_queried_object_id() // Используем tag_id вместо category__in
); );
$query = new WP_Query($args); $query = new WP_Query($args);
// Передаем query через глобальную переменную $wp_query, чтобы избежать ошибки
global $wp_query;
$original_query = $wp_query;
$wp_query = $query;
get_template_part('partials/post-list');
// Восстанавливаем оригинальный запрос
$wp_query = $original_query;
wp_reset_postdata();
?> ?>
<?php get_template_part('partials/post-list', null, ['query' => $query]); ?>
</div> </div>
<?php custom_pagination(); ?> <?php custom_pagination(); ?>
</div> </div>

View File

@@ -1,34 +0,0 @@
<?php get_header(); ?>
<div class="content-middle articles-wrapper">
<?php get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title desktop">
<?php if (is_tag()) : ?>
<h1 class="section-title__title"><?= single_tag_title('', false) ?></h1>
<?php endif; ?>
</div>
<div class="articles-preview">
<?php
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 13,
'paged' => $paged,
'tag_id' => get_queried_object_id() // Используем tag_id вместо category__in
);
$query = new WP_Query($args);
// Передаем query через глобальную переменную $wp_query, чтобы избежать ошибки
global $wp_query;
$original_query = $wp_query;
$wp_query = $query;
get_template_part('partials/post-list');
// Восстанавливаем оригинальный запрос
$wp_query = $original_query;
wp_reset_postdata();
?>
</div>
<?php custom_pagination(); ?>
</div>
<?php get_footer(); ?>