add landing
This commit is contained in:
0
content-post-rfo-inter.php
Normal file
0
content-post-rfo-inter.php
Normal file
@@ -1,10 +1,12 @@
|
||||
<?php
|
||||
$formatted_date = format_event_date();
|
||||
$full_width = $args['full_width'] ?? false;
|
||||
$class = $full_width ? 'article-item-main__rfo' : 'article-item-rfo';
|
||||
//$class = $full_width ? 'article-item-main__rfo' : 'article-item-rfo';
|
||||
$class = isset($args['class']) ? $args['class'] : 'article-item-rfo';
|
||||
|
||||
?>
|
||||
<div class="article-item-wrapper__rfo">
|
||||
<div class="<?= $class; ?>">
|
||||
<div class="<?=$class; ?>">
|
||||
<a href="<?php the_permalink(); ?>" class="article-item__image-container">
|
||||
<?=render_webp_picture_by_post( null, 'news-list-picture'); ?>
|
||||
</a>
|
||||
|
||||
@@ -30,6 +30,8 @@ import './styles/rfo/featured.css';
|
||||
import './styles/rfo/social.css';
|
||||
import './styles/rfo/article.css';
|
||||
import './styles/rfo/breadcrumbs.css';
|
||||
import './styles/rfo/landing.css';
|
||||
|
||||
|
||||
|
||||
import './scripts/calendar.js';
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
flex-shrink: 0;
|
||||
height: 409px;
|
||||
width: 397px;
|
||||
background: #f1f3eb; /* пример фона */
|
||||
background: #f1f3eb; /* пример фона */
|
||||
|
||||
|
||||
/* МАСКА через встроенный data URI */
|
||||
-webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 387 409"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.79428 0L378.205 0C383.042 0 386.999 3.9499 386.999 8.77793V34.6476V374.353V400.222C386.999 405.05 383.042 409 378.205 409H225.707C219.54 409 218.385 405.144 215.499 400.222L209.392 389.805C207.382 386.378 203.127 383.509 199.559 383.13H8.79426C3.95665 383.13 0 379.181 0 374.352V8.77756C0 3.94952 3.95667 0 8.79428 0Z" fill="black"/></svg>');
|
||||
@@ -40,6 +41,34 @@
|
||||
mask-size: cover;
|
||||
}
|
||||
|
||||
.item-rfo-zh{
|
||||
fill: var(--zheltyy);
|
||||
background: var(--zheltyy);
|
||||
}
|
||||
|
||||
.item-rfo-zel{
|
||||
fill: var(--zelenyy);
|
||||
background: var(--zelenyy);
|
||||
}
|
||||
|
||||
|
||||
.item-rfo-orange{
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
height: 409px;
|
||||
width: 397px;
|
||||
|
||||
background: #f1f3eb; /* пример фона */
|
||||
-webkit-mask-image: url('/wp-content/themes/agroexpert/frontend/img/orange-article.svg');
|
||||
-webkit-mask-repeat: no-repeat;
|
||||
-webkit-mask-size: cover;
|
||||
|
||||
mask-image: url('/wp-content/themes/agroexpert/frontend/img/orange-article.svg');
|
||||
mask-repeat: no-repeat;
|
||||
mask-size: cover;
|
||||
|
||||
}
|
||||
|
||||
.post-title__rfo{
|
||||
font-family: var(--second-family);
|
||||
font-weight: 700;
|
||||
@@ -120,8 +149,6 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center; /* центрирование по горизонтали */
|
||||
width: ;
|
||||
|
||||
}
|
||||
|
||||
.pagination__rfo {
|
||||
|
||||
133
frontend/src/styles/rfo/landing.css
Normal file
133
frontend/src/styles/rfo/landing.css
Normal file
@@ -0,0 +1,133 @@
|
||||
.header-rfo__landing{
|
||||
width: 100%;
|
||||
height: 728px;
|
||||
background-image: url('https://agroexpert.press/wp-content/themes/agroexpert/frontend/img/rfo-landing.png');
|
||||
background-size: cover; /* Заполняет весь блок, обрезая края */
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.rfo-rubrics-line{
|
||||
display: flex;
|
||||
gap: 28px;
|
||||
}
|
||||
|
||||
.end-interview__wrapper{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.land-cart-title{
|
||||
display: flex;
|
||||
padding: 2px 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.land-cart-title__text{
|
||||
flex-grow: 1;
|
||||
font-family: var(--second-family);
|
||||
font-weight: 700;
|
||||
font-size: 1.8em;
|
||||
line-height: 150%;
|
||||
text-transform: uppercase;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.land-cart-title__arrow{
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-left: 16px;
|
||||
background-image: url('https://agroexpert.press/wp-content/themes/agroexpert/frontend/img/lang-arrow.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.land-title__arrow{
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-left: 8px;
|
||||
background-image: url('https://agroexpert.press/wp-content/themes/agroexpert/frontend/img/lang-arrow.svg');
|
||||
}
|
||||
|
||||
.landing-block__rfo{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 22px;
|
||||
}
|
||||
|
||||
.about-block__rfo{
|
||||
display: flex;
|
||||
width: 1200px;
|
||||
justify-content: center; /* горизонтальное центрирование */
|
||||
align-items: center; /* вертикальное центрирование * /* важно задать высоту */
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.about-block_content__rfo{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
gap: 28px;
|
||||
margin: 22px 0;
|
||||
max-width: 100%;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.about-block_title__rfo{
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.about-block_name__rfo{
|
||||
font-family: var(--second-family);
|
||||
font-weight: 700;
|
||||
font-size: 2.2em;
|
||||
line-height: 150%;
|
||||
text-transform: uppercase;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.about-block-slogan__rfo{
|
||||
flex: 0 0 30%;
|
||||
font-family: var(--second-family);
|
||||
font-weight: 700;
|
||||
font-size: 1.6rem;
|
||||
line-height: 150%;
|
||||
text-transform: uppercase;
|
||||
color: #006842;
|
||||
margin-left: 28px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
.header-rfo__landing{
|
||||
width: 100%;
|
||||
height: 289px;
|
||||
background-image: url('https://agroexpert.press/wp-content/themes/agroexpert/frontend/img/rfo-landing-mob.png');
|
||||
}
|
||||
|
||||
.rfo-rubrics-line{
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.about-block__rfo{
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.about-block_content__rfo,
|
||||
.about-block-slogan__rfo{
|
||||
flex: 1 1 100%; /* На всю ширину */
|
||||
width: 100%; /* На всякий случай */
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,15 @@
|
||||
:root {
|
||||
--belyy: #fff;
|
||||
--zheltyy: #ffdb96;
|
||||
--zelenyy: #c9fec8;
|
||||
--zelenyy-2: #006842;
|
||||
--oranzhevyy: #f18917;
|
||||
--001: #101828;
|
||||
--seryy: #c4d3d9;
|
||||
--2: #f1f3eb;
|
||||
--tekst: #2f2f2f;
|
||||
}
|
||||
|
||||
.header-rfo {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
@@ -54,6 +66,17 @@
|
||||
/**width: 1200px;
|
||||
max-width: 1200px;**/
|
||||
}
|
||||
|
||||
.content-rfo-land{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: -22px;
|
||||
padding-bottom: 42px;
|
||||
/**width: 1200px;
|
||||
max-width: 1200px;**/
|
||||
}
|
||||
|
||||
|
||||
.content-rfo-min{
|
||||
margin-top: -222px;
|
||||
border: 0;
|
||||
@@ -146,6 +169,10 @@
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
.content-rfo-land{
|
||||
margin-top: -22px;
|
||||
}
|
||||
|
||||
.header__inner_rfo{
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
105
header-rfo-landing.php
Normal file
105
header-rfo-landing.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
|
||||
<head itemscope itemtype="https://schema.org/WPHeader">
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="zen-verification" content="xdaKRGoPCQTgRYUKZ7tBq2pDm8JxN4zVv8KxInVPCyE11AQGYpdnVL5ocisUY6w7" />
|
||||
<meta name="google-site-verification" content="wKVjdTPQrw11PE9o4Blxqv7qbdFmxarn8ez4fCJd_po" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<meta name="yandex-verification" content="209d13da5a697e41" />
|
||||
<?php wp_head(); ?>
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript" >
|
||||
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||
m[i].l=1*new Date();
|
||||
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
||||
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||
|
||||
ym(96621494, "init", {
|
||||
clickmap:true,
|
||||
trackLinks:true,
|
||||
accurateTrackBounce:true
|
||||
});
|
||||
</script>
|
||||
<noscript><div><img src="https://mc.yandex.ru/watch/96621494" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
<!-- Yandex.RTB -->
|
||||
<script>window.yaContextCb=window.yaContextCb||[]</script>
|
||||
<script src="https://yandex.ru/ads/system/context.js" async></script>
|
||||
<!-- Google Tag Manager -->
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','GTM-W6Z5FN8Z');</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W6Z5FN8Z"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
</head>
|
||||
|
||||
|
||||
<body <?php body_class(); ?>>
|
||||
<?php wp_body_open(); ?>
|
||||
<div id="app">
|
||||
<?if (function_exists('krutilka_placement')):?>
|
||||
<div class="banner banner--header desktop">
|
||||
<?=krutilka_placement( 'top-desktop' );?>
|
||||
</div>
|
||||
<div class="banner banner--header mobile">
|
||||
<?=krutilka_placement( 'top-mob' );?>
|
||||
</div>
|
||||
<?endif?>
|
||||
<header class="header-rfo__landing">
|
||||
<div class="container">
|
||||
<div class="header__inner_rfo">
|
||||
<div class="header-rfo-line">
|
||||
<?php get_template_part('rfo/logoline'); ?>
|
||||
</div>
|
||||
|
||||
<form action="https://wordpress.org/search/" method="get" target="_blank">
|
||||
<div class="search-container-rfo desktop">
|
||||
<input class="search-input-rfo" type="text" name="q" placeholder="Поиск..." required>
|
||||
<button type="submit" class="search-icon-rfo">
|
||||
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 6.77778C10.5636 6.77778 7.77778 9.56356 7.77778 13C7.77778 16.4364 10.5636 19.2222 14 19.2222C17.4364 19.2222 20.2222 16.4364 20.2222 13C20.2222 9.56356 17.4364 6.77778 14 6.77778ZM6 13C6 8.58172 9.58172 5 14 5C18.4183 5 22 8.58172 22 13C22 17.4183 18.4183 21 14 21C9.58172 21 6 17.4183 6 13Z" fill="black" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.2767 18.2767C18.6457 17.9078 19.244 17.9078 19.613 18.2767L23.7233 22.387C24.0922 22.756 24.0922 23.3543 23.7233 23.7233C23.3543 24.0922 22.756 24.0922 22.387 23.7233L18.2767 19.613C17.9078 19.244 17.9078 18.6457 18.2767 18.2767Z" fill="black" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<nav class="header-rfo-menuline desktop">
|
||||
<?php get_template_part('rfo/menu-rfo'); ?>
|
||||
</nav>
|
||||
<div class="header__burger">
|
||||
<img src="<?= get_asset('/images/burger.svg') ?>" alt="" />
|
||||
<img src="<?= get_asset('/images/burger_close.svg') ?>" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="main">
|
||||
<?php if (function_exists('yoast_breadcrumb') && !is_front_page()) : ?>
|
||||
<div class="breadcrumbs">
|
||||
<div class="container">
|
||||
<?php yoast_breadcrumb('<div class="breadcrumbs__list">', '</div>'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!is_404() && !is_500()) : ?>
|
||||
<div class="container">
|
||||
|
||||
|
||||
<? endif; ?>
|
||||
@@ -1,11 +1,18 @@
|
||||
<?php
|
||||
|
||||
add_filter('category_template', function($template) {
|
||||
|
||||
$current_category = get_queried_object();
|
||||
|
||||
if ( $current_category->slug == 'rfo' ) {
|
||||
$rfo_template = locate_template('rfo/landing.php');
|
||||
if ($rfo_template) return $rfo_template;
|
||||
}
|
||||
|
||||
// Только родительские рубрики (их дочерние подрубрики подхватятся автоматически)
|
||||
$target_parent_slugs = ['forest', 'rfo']; // Только slug родительских рубрик
|
||||
|
||||
|
||||
// Получаем родительскую рубрику
|
||||
$parent_category = $current_category->parent
|
||||
? get_category($current_category->parent)
|
||||
@@ -19,6 +26,7 @@ add_filter('category_template', function($template) {
|
||||
}
|
||||
|
||||
return $template;
|
||||
|
||||
});
|
||||
|
||||
add_filter('single_template', function($template) {
|
||||
|
||||
48
rfo/category-end.php
Normal file
48
rfo/category-end.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Category Block Template
|
||||
*
|
||||
* @param array $args {
|
||||
* @type string $category Slug рубрики (по умолчанию 'rfo')
|
||||
* @type string $title Заголовок блока (по умолчанию 'Интервью')
|
||||
* @type int $posts_count Количество постов (по умолчанию 1)
|
||||
* }
|
||||
*/
|
||||
|
||||
// Извлекаем параметры
|
||||
$category = isset($args['category']) ? $args['category'] : 'rfo';
|
||||
$title = isset($args['title']) ? $args['title'] : 'РФО';
|
||||
$style = isset($args['style']) ? $args['style'] : 0;
|
||||
$posts_count = isset($args['posts_count']) ? $args['posts_count'] : 1;
|
||||
?>
|
||||
|
||||
<div class="custom-category-block" data-category="<?php echo esc_attr($category); ?>">
|
||||
<?php
|
||||
$query_args = array(
|
||||
'category_name' => $category,
|
||||
'posts_per_page' => $posts_count,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC'
|
||||
);
|
||||
|
||||
$query = new WP_Query($query_args);
|
||||
|
||||
if ($query->have_posts()) : ?>
|
||||
|
||||
<div class="article-item-wrapper__rfo">
|
||||
<div class="land-cart-title">
|
||||
<div class="land-cart-title__text"><?php echo esc_html($title); ?></div>
|
||||
<div class="land-cart-title__arrow"></div>
|
||||
</div>
|
||||
|
||||
<div class="article-item-rfo">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<?get_template_part( 'content', 'post-rfo', [ 'class'=>'article-item-rfo '.$style ] );?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif;
|
||||
|
||||
wp_reset_postdata(); ?>
|
||||
</div>
|
||||
33
rfo/end-interview.php
Normal file
33
rfo/end-interview.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php $args = array(
|
||||
'category_name' => 'rfo', // или 'category_id' => X
|
||||
'posts_per_page' => 1,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC'
|
||||
);
|
||||
|
||||
$last_post = new WP_Query($args);
|
||||
|
||||
if ($last_post->have_posts()) {?>
|
||||
|
||||
<div class="content-rfo">
|
||||
|
||||
<?//while ($last_post->have_posts()) {?>
|
||||
|
||||
<div class="article-item-wrapper__rfo">
|
||||
<div class="land-cart-title">
|
||||
<div class="land-cart-title__text">Интервью</div>
|
||||
<div class="land-cart-title__arrow"></div>
|
||||
</div>
|
||||
<div class="article-item-rfo item-rfo-zh">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?//}?>
|
||||
</div>
|
||||
<?wp_reset_postdata(); // Сбрасываем данные поста
|
||||
}
|
||||
51
rfo/landing.php
Normal file
51
rfo/landing.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php get_header( 'rfo-landing' ); ?>
|
||||
|
||||
<div class="content-rfo-land">
|
||||
|
||||
<div class="rfo-rubrics-line">
|
||||
|
||||
<?php get_template_part('rfo/category-end', null, [
|
||||
'category' => 'rfo', // slug рубрики
|
||||
'style' => 'item-rfo-zh'
|
||||
]);?>
|
||||
|
||||
<?php get_template_part('rfo/category-end', null, [
|
||||
'category' => 'rfo', // slug рубрики
|
||||
'style' => 'item-rfo-zel'
|
||||
]);?>
|
||||
|
||||
<?php get_template_part('rfo/category-end', null, [
|
||||
'category' => 'rfo', // slug рубрики
|
||||
'style' => 'item-rfo-zh'
|
||||
]);?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="about-block__rfo">
|
||||
<div class="about-block_content__rfo">
|
||||
<div class="about-block_title__rfo">
|
||||
<div class="about-block_name__rfo"> О проекте</div>
|
||||
<div class="land-title__arrow"></div>
|
||||
</div>
|
||||
<div class="about-block_text__rfo"><p>Фумигационный отряд создан в 1962 г. Госинспекцией по карантину растений Министерства сельского хозяйства СССР, Приказом Министерства сельского хозяйства Российской Федерации № 735 от 14 мая 2003 г. переименован в Федеральное государственное унитарное предприятие «Республиканский фумигационный отряд», Распоряжением Правительства Российской Федерации № 1592-р от 26 июля 2016 г. изменена организационно-правовая форма на Федеральное казенное предприятие «Республиканский фумигационный отряд»</p></div>
|
||||
</div>
|
||||
<div class="about-block-slogan__rfo">
|
||||
БОЛЕЕ 60 ЛЕТ<br>МЫ СОХРАНЯЕМ
ВАШ ПРОДУКТ!
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="landing-block__rfo">
|
||||
<div class="about-block_title__rfo">
|
||||
<div class="about-block_name__rfo">Новости</div>
|
||||
<div class="land-title__arrow"></div>
|
||||
</div>
|
||||
|
||||
<?php get_template_part('rfo/news-landing');?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php get_footer( 'rfo' ); ?>
|
||||
24
rfo/news-landing.php
Normal file
24
rfo/news-landing.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$args = array(
|
||||
'category__in' => 3700,
|
||||
'post__not_in' => array($current_post_id),
|
||||
'posts_per_page' => 3,
|
||||
);
|
||||
|
||||
$related_posts_query = new WP_Query($args);
|
||||
|
||||
if ($related_posts_query->have_posts()) {
|
||||
echo '<div class="related-posts">';
|
||||
echo '<div class="articles-preview-rfo">';
|
||||
|
||||
while ($related_posts_query->have_posts()) {
|
||||
$related_posts_query->the_post();
|
||||
get_template_part('content', 'post-rfo');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
wp_reset_postdata();
|
||||
}
|
||||
|
||||
18
tag.php
18
tag.php
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user