correct rubrics rfo

This commit is contained in:
argoexpert press
2025-06-19 18:45:43 +03:00
parent 0c4e403479
commit 7f1f54f885
2 changed files with 43 additions and 6 deletions

View File

@@ -5,18 +5,21 @@
<div class="rfo-rubrics-line">
<?php get_template_part('rfo/category-end', null, [
'category' => 'rfo', // slug рубрики
'style' => 'item-rfo-zh'
'category' => 'opinion', // slug рубрики
'style' => '',
'title' => 'Интервью'
]);?>
<?php get_template_part('rfo/category-end', null, [
'category' => 'rfo', // slug рубрики
'style' => 'item-rfo-zel'
'category' => 'fumigation', // slug рубрики
'style' => 'item-rfo-zh',
'title' => 'Фумигация'
]);?>
<?php get_template_part('rfo/category-end', null, [
'category' => 'rfo', // slug рубрики
'style' => 'item-rfo-zh'
'category' => 'zashchita-rasteniy', // slug рубрики
'style' => 'item-rfo-zel',
'title' => 'Защита растений'
]);?>

34
tag_old.php Normal file
View File

@@ -0,0 +1,34 @@
<?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(); ?>