introducing breadcrumb on page
This commit is contained in:
parent
79dcb9b2f9
commit
647a21efc2
44
page.php
44
page.php
|
|
@ -5,19 +5,43 @@ $mainThematique = getMainThematique($currentThematique);
|
||||||
$thematiqueColorSlug = $mainThematique->slug;
|
$thematiqueColorSlug = $mainThematique->slug;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="homegrade-page-container <?php echo $thematiqueColorSlug ? "homegrade-page-container--" . $thematiqueColorSlug : "" ?>">
|
|
||||||
|
|
||||||
<?php if (have_posts()) : ?>
|
<div class="homegrade-page-container <?php echo $thematiqueColorSlug ? "homegrade-page-container--" . $thematiqueColorSlug : "" ?>">
|
||||||
|
|
||||||
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||||
|
|
||||||
|
<nav class=" breadcrumbs_navigation" aria-label="breadcrumbs">
|
||||||
|
<?php
|
||||||
|
$currentPage = get_post();
|
||||||
|
$parentPage = $currentPage->post_parent !== 0 ? get_post($currentPage->post_parent) : null;
|
||||||
|
$grandParentPage = $parentPage->post_parent ? get_post($parentPage->post_parent) : null;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo home_url() ?>" title="<?php echo __("Accueil", "homegrade-theme__texte-fonctionnel") ?>">
|
||||||
|
<img src="<?php echo get_template_directory_uri() . "/resources/img/pictogrammes/icon_house_dark.svg" ?>" alt="">
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php if ($grandParentPage) : ?>
|
||||||
|
<li><a href="<?php echo get_post_permalink($grandParentPage) ?>"><?php echo $grandParentPage->post_title ?></a></li>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($parentPage) : ?>
|
||||||
|
<li><a href="<?php echo get_post_permalink($parentPage) ?>"><?php echo $parentPage->post_title ?></a></li>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($currentPage) : ?>
|
||||||
|
<li><a href="<?php echo get_post_permalink($currentPage) ?>" aria-current="location"><?php echo $currentPage->post_title ?></a></li>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
while (have_posts()) :
|
the_content();
|
||||||
the_post();
|
|
||||||
the_content();
|
|
||||||
?>
|
?>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
<?php endwhile; ?>
|
</div>
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php get_footer();
|
<?php get_footer();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user