add cookies
This commit is contained in:
@@ -22,22 +22,33 @@ function render_full_category_breadcrumbs( $cat_id, &$position = 1, $separator =
|
||||
$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();
|
||||
if ( empty( $categories ) ) return;
|
||||
|
||||
$main_cat = $categories[0];
|
||||
$breadcrumb_position = 1;
|
||||
$show_datetime = is_news_category( $main_cat->term_id );
|
||||
?>
|
||||
|
||||
<nav class="breadcrumbs" aria-label="Навигация по рубрикам" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||||
<ol class="breadcrumbs_list" itemprop="itemListElement">
|
||||
<?php render_full_category_breadcrumbs( $main_cat->term_id, $breadcrumb_position ); ?>
|
||||
<?php if ( $show_datetime ) : ?>
|
||||
<li property="itemListElement" typeof="ListItem">
|
||||
<span property="item" typeof="WebPage" itemprop="name"><?php the_time('j F Y, H:i \М\С\К'); ?></span>
|
||||
<meta property="position" content="<?php echo ++$breadcrumb_position; ?>" />
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<div class="subscripts"> Подпишитесь на Спорт
|
||||
<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>
|
||||
<div class="subscripts"> Читайте нас в
|
||||
<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">Телеграм</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>
|
||||
Reference in New Issue
Block a user