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.
qdouze2-wordpress-theme/components/article/breadcrumb.php

21 lines
989 B
PHP
Raw Normal View History

2022-12-17 19:46:29 +01:00
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
2022-12-18 09:46:44 +01:00
<li class='breadcrumb-item'><a href='<?php echo site_url(); ?>'>Quarante-Douze</a></li><?php
2022-12-17 19:46:29 +01:00
if (has_category('chapters')) {
$romans = get_the_terms($post->ID, 'roman');
foreach( $romans as $roman ) {
echo "<li class='breadcrumb-item'><a href='" . esc_url( get_category_link( $roman->term_id ) ) . "'><i class='fa fa-book'></i> " . $roman->name . "</a></li>";
}
} else {
$categories = get_the_category();
foreach( $categories as $category ) {
echo "<li class='breadcrumb-item'><a href='" . esc_url( get_category_link( $category->term_id ) ) . "'><i class='fa fa-folder-open'></i> " . $category->cat_name . "</a></li>";
}
}
?><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-file" aria-hidden="true"></i> <?php echo the_title(); ?></span></li>
</ol>
</nav>
</div>