- 17, May 2024
- #1
Я получаю сообщение об ошибке itemlistelement на странице категории. Как мне это сделать?
<div class="breadcrumb" itemscope="" itemtype="[URL='https://lumtu.com/yti/cpxxpc3RodHRwczovL3NjaGVtYS5vcmcvQnJlYWRjcnVtYktVn']https://schema.org/BreadcrumbList[/URL]">
<a href="<?php bloginfo('url'); ?>">Anasayfa</a>
<?php
$bu_kategori = get_category(get_query_var('cat'));
$parent = $bu_kategori->category_parent;
$breadDizi = array();
do{
if ( $parent != 0) {
$ust_kategori = get_category($parent);
$breadDizi[] = array(
"term_id" => get_category_link($ust_kategori->term_id),
"name" => $ust_kategori->name,
);
$parent = $ust_kategori->category_parent;
}
}while($parent > 0);
$newBread = array_reverse($breadDizi, true);
foreach ($newBread as $value) {
?>
<span aria-label="breadcrumb separator">/</span>
<a href="<?=$value["term_id"]?>" title="<?=$значение["name"]?>"><?=$value["name"]?></a>
<?php
}
?>
<span aria-label="breadcrumb separator">/</span>
<?=$bu_kategori->name?>
</div>
PHP: