add landing

This commit is contained in:
2025-06-19 16:12:53 +03:00
parent cd0c2b9f97
commit 0c4e403479
13 changed files with 469 additions and 19 deletions

18
tag.php
View File

@@ -2,8 +2,8 @@
<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 if (is_category()) : ?>
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
<?php endif; ?>
</div>
<div class="articles-preview">
@@ -13,21 +13,11 @@
'post_type' => 'post',
'posts_per_page' => 13,
'paged' => $paged,
'tag_id' => get_queried_object_id() // Используем tag_id вместо category__in
'category__in' => get_queried_object_id()
);
$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>
<?php custom_pagination(); ?>
</div>