handling classic page template

This commit is contained in:
Antoine M 2024-11-12 10:17:27 +01:00
parent 90a9d05c6f
commit 1198242f44

43
page.php Normal file
View File

@ -0,0 +1,43 @@
<?php get_header(); ?>
<div class="homegrade-page-container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
<?php
$currentPage = get_post();
$parentPage = $currentPage->post_parent !== 0 ? get_post($currentPage->post_parent) : null;
$networkHomeUrl = network_home_url();
$frontPageUrl = get_home_url();
$frontPageTitle = get_the_title(get_option('page_on_front'));
?>
<ol>
<li>
<a href="<?php echo $networkHomeUrl ?>" 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>
<li><a href="<?php echo $frontPageUrl ?>"><?php echo $frontPageTitle ?></a></li>
<?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" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
<?php endif; ?>
</ol>
</nav>
<?php
the_content();
?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php get_footer();