This repository has been archived on 2024-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
kspace-wordpress-theme/components/article/breadcrumb.php

21 lines
917 B
PHP
Raw Permalink Normal View History

<div class="flex-that d-none d-flex-sm pl-half pr-half">
2021-01-04 12:00:40 +01:00
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class='breadcrumb-item'><a href='<?php echo site_url(); ?>'>kazhnuz.space</a></li><?php
if (has_category('chapters')) {
$romans = get_the_terms($post->ID, 'roman');
foreach( $romans as $roman ) {
2023-11-18 12:17:07 +01:00
echo "<li class='breadcrumb-item'><a href='" . esc_url( get_category_link( $roman->term_id ) ) . "'> " . $roman->name . "</a></li>";
}
} else {
$categories = get_the_category();
2021-01-04 12:00:40 +01:00
foreach( $categories as $category ) {
2023-11-18 12:17:07 +01:00
echo "<li class='breadcrumb-item'><a href='" . esc_url( get_category_link( $category->term_id ) ) . "'> " . $category->cat_name . "</a></li>";
}
}
2023-11-18 12:17:07 +01:00
?><li class="breadcrumb-item" aria-current="page"><span class="active"> <?php echo the_title(); ?></span></li>
2021-01-04 12:00:40 +01:00
</ol>
</nav>
</div>