add cookies

This commit is contained in:
2026-01-09 18:13:48 +03:00
parent a1393e8b13
commit 64a4db8d8e
6 changed files with 41 additions and 20 deletions

View File

@@ -4,12 +4,13 @@
<div class="maintitle"> <div class="maintitle">
<h1><?php single_cat_title(); ?></h1> <h1><?php single_cat_title(); ?></h1>
<div class="h-telega"><a href="https://t.me/sportpressa" target="_blank">@sportpressa</a></div> <div class="h-telega"><a href="https://t.me/sportpressa" target="_blank">@sportpressa</a></div>
<?php if (category_description()) : ?> </div>
<?php if (category_description() && !is_paged()) : ?>
<div class="category-description"> <div class="category-description">
<?php echo category_description(); ?> <?php echo category_description(); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div>
<?php get_template_part('template-parts/content', 'cards'); ?> <?php get_template_part('template-parts/content', 'cards'); ?>
@@ -25,3 +26,4 @@
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@@ -5,6 +5,8 @@
<?php wp_footer(); ?> <?php wp_footer(); ?>
<?php get_template_part( 'template-parts/cookie-consent' ); ?>
<footer> <footer>
<a href="#top" class="to-top"><svg width="53" height="53" viewBox="0 0 53 53" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="53" height="53" fill="#006842"></rect> <path d="M26.9091 24.1732L39.8181 31.6279L39.8181 24.4546L26.9091 16.9999L26.9091 24.1732Z" fill="#F18917"></path> <path d="M26.909 24.1732L14 31.6279L14 24.4546L26.909 16.9999L26.909 24.1732Z" fill="#F18917"></path> </svg></a> <a href="#top" class="to-top"><svg width="53" height="53" viewBox="0 0 53 53" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="53" height="53" fill="#006842"></rect> <path d="M26.9091 24.1732L39.8181 31.6279L39.8181 24.4546L26.9091 16.9999L26.9091 24.1732Z" fill="#F18917"></path> <path d="M26.909 24.1732L14 31.6279L14 24.4546L26.909 16.9999L26.909 24.1732Z" fill="#F18917"></path> </svg></a>
<div class="footer-content"> <div class="footer-content">
@@ -16,6 +18,7 @@
</div> </div>
<div class="rating">18+</div> <div class="rating">18+</div>
</div> </div>
<?php get_template_part( 'template-parts/subscripts-promo' ); ?>
<div id="copyr"> <div id="copyr">
© Сетевое издание Спортпресса, 2018 - <?=date('Y')?> (sportpressa.ru). Учредитель: Синьковский Петр Сергеевич. Главный редактор: Синьковский П.С. Электронный адрес: info@sportpressa.ru. Телефон редакции: +7(495)511-49-05. Свидетельство о регистрации ЭЛ № ФС 77 - 73274 от 13.07.2018 года. Выдано Федеральной службой по надзору в сфере связи, информационных технологий и массовых коммуникаций (Роскомнадзор). 2002-2024 SportPressa.ru™ Все права защищены. © Сетевое издание Спортпресса, 2018 - <?=date('Y')?> (sportpressa.ru). Учредитель: Синьковский Петр Сергеевич. Главный редактор: Синьковский П.С. Электронный адрес: info@sportpressa.ru. Телефон редакции: +7(495)511-49-05. Свидетельство о регистрации ЭЛ № ФС 77 - 73274 от 13.07.2018 года. Выдано Федеральной службой по надзору в сфере связи, информационных технологий и массовых коммуникаций (Роскомнадзор). 2002-2024 SportPressa.ru™ Все права защищены.
</div> </div>

View File

@@ -95,9 +95,6 @@
</div> </div>
</noscript> </noscript>
<!-- //Rating@Mail.ru counter --> <!-- //Rating@Mail.ru counter -->
<!-------------------------------------------------------------------------------- Статусная строка -->
</head> </head>
@@ -112,7 +109,7 @@
<div class="site-header-content"> <div class="site-header-content">
<div class="sportpressa-logo"> <div class="sportpressa-logo">
<a href="<?php echo home_url()?>"><span class="redword">С</span>порт</a> <a href="<?php echo home_url()?>"><span class="redword">С</span>порт</a>
<img src="<?php echo home_url()?>/sportpressa.svg" width="40"> <img src="<?php echo home_url()?>/sportpressa.svg" width="30">
<a href="<?php echo home_url()?>">Пресса</a> <a href="<?php echo home_url()?>">Пресса</a>
</div> </div>
@@ -120,6 +117,7 @@
<span class="hamburger-icon"></span> <span class="hamburger-icon"></span>
</button> </button>
<div class="mobile-menu-overlay"> <div class="mobile-menu-overlay">
<button class="mobile-menu-close" id="mobile-menu-close" aria-label="Закрыть меню"> <button class="mobile-menu-close" id="mobile-menu-close" aria-label="Закрыть меню">
<span class="close-icon"></span> <span class="close-icon"></span>
@@ -135,6 +133,7 @@
) ); ) );
?> ?>
</nav> </nav>
</div> </div>
<nav class="desktop-nav"> <nav class="desktop-nav">
@@ -147,6 +146,9 @@
) ); ) );
?> ?>
</nav> </nav>
<?php //get_template_part( 'template-parts/subscripts-promo' ); ?>
</div> </div>
</header> </header>

View File

@@ -2,14 +2,15 @@
<main class="main"> <main class="main">
<div class="maintitle"> <div class="maintitle">
<h1>#<?php single_tag_title(); ?></h1> <h1 class="hashtag-title"><?php single_tag_title(); ?></h1>
<div class="h-telega"><a href="https://t.me/sportpressa" target="_blank">@sportpressa</a></div> <div class="h-telega"><a href="https://t.me/sportpressa" target="_blank">@sportpressa</a></div>
<?php if (tag_description()) : ?> </div>
<div class="tag-description">
<?php if (tag_description() && !is_paged()) : ?>
<div class="category-description">
<?php echo tag_description(); ?> <?php echo tag_description(); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div>
<?php get_template_part('template-parts/content', 'cards'); ?> <?php get_template_part('template-parts/content', 'cards'); ?>

View File

@@ -22,22 +22,33 @@ function render_full_category_breadcrumbs( $cat_id, &$position = 1, $separator =
$position++; $position++;
} }
// Функция проверки принадлежности к рубрике Новости
function is_news_category( $cat_id ) {
$news_cat = get_category_by_slug( 'news' );
if ( ! $news_cat ) return false;
// Проверяем, является ли текущая категория "Новости" или её потомком
return ( $cat_id == $news_cat->term_id || cat_is_ancestor_of( $news_cat->term_id, $cat_id ) );
}
$categories = get_the_category(); $categories = get_the_category();
if ( empty( $categories ) ) return; if ( empty( $categories ) ) return;
$main_cat = $categories[0]; $main_cat = $categories[0];
$breadcrumb_position = 1; $breadcrumb_position = 1;
$show_datetime = is_news_category( $main_cat->term_id );
?> ?>
<nav class="breadcrumbs" aria-label="Навигация по рубрикам" itemscope itemtype="https://schema.org/BreadcrumbList"> <nav class="breadcrumbs" aria-label="Навигация по рубрикам" itemscope itemtype="https://schema.org/BreadcrumbList">
<ol class="breadcrumbs_list" itemprop="itemListElement"> <ol class="breadcrumbs_list" itemprop="itemListElement">
<?php render_full_category_breadcrumbs( $main_cat->term_id, $breadcrumb_position ); ?> <?php render_full_category_breadcrumbs( $main_cat->term_id, $breadcrumb_position ); ?>
<?php if ( $show_datetime ) : ?>
<li property="itemListElement" typeof="ListItem"> <li property="itemListElement" typeof="ListItem">
<span property="item" typeof="WebPage" itemprop="name"><?php the_time('j F Y, H:i \М\С\К'); ?></span> <span property="item" typeof="WebPage" itemprop="name"><?php the_time('j F Y, H:i \М\С\К'); ?></span>
<meta property="position" content="<?php echo ++$breadcrumb_position; ?>" /> <meta property="position" content="<?php echo ++$breadcrumb_position; ?>" />
</li> </li>
<?php endif; ?>
</ol> </ol>
</nav> </nav>

View File

@@ -1,4 +1,6 @@
<div class="subscripts"> Подпишитесь на Спорт&nbsp; <div class="subscripts"> Читайте нас в&nbsp;
<a class="btn_sub_social" href="https://dzen.ru/sportpressa.ru" target="_blank">Дзен</a> <a class="btn_sub_social" href="https://dzen.ru/sportpressa.ru" target="_blank">Дзен</a>
<a class="btn_sub_social" href="https://t.me/sportpressa" target="_blank">Telegram</a> <a class="btn_sub_social" href="https://t.me/sportpressa" target="_blank">Телеграм</a>
<a class="btn_sub_social" href="https://vk.com/sportpressa" target="_blank">ВК</a>
<a class="btn_sub_social desc" href="https://ok.ru/sportpressa" target="_blank">ОК</a>
</div> </div>