' ) {
$cat = get_category( $cat_id );
if ( ! $cat ) return;
// Рекурсивно выводим родителей
if ( $cat->parent != 0 ) {
render_full_category_breadcrumbs( $cat->parent, $position, $separator );
}
// Выводим категорию с Schema.org структурой
echo '
' . esc_html( $cat->name ) . '
';
$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 );
?>