working on parcours singles data loop
This commit is contained in:
parent
73cc99a57d
commit
b0ae50409d
|
|
@ -1,8 +1,75 @@
|
|||
<?php
|
||||
|
||||
|
||||
$parentTitle = get_the_title($post->post_parent) ?? null;
|
||||
$parentUrl = get_the_permalink($post->post_parent) ?? null;
|
||||
$pageIcon = get_field('step_icon', $post->ID);
|
||||
?>
|
||||
|
||||
<article class="container my-8 mx-auto entry-content single-editor-content <?php echo $thematiqueColorSlug ? "entry-content--" . $thematiqueColorSlug : "" ?>">
|
||||
<div class="post-parcours-page-container">
|
||||
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
|
||||
<?php
|
||||
$archiveParcours = get_page_by_template('template-parcours-renovateur.php')[0];
|
||||
?>
|
||||
<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>
|
||||
<li><a href="<?php echo get_post_permalink($archiveParcours) ?>"><?php echo $archiveParcours->post_title ?></a></li>
|
||||
<li><a href="<?php echo $parentUrl ?>"><?php echo $parentTitle ?></a></li>
|
||||
<li><a href="<?php echo the_permalink() ?>" aria-current="location" aria-disabled="true"><?php echo get_queried_object()->post_title ?></a></li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
<?php /* --------
|
||||
HEADING BOX
|
||||
---------------*/ ?>
|
||||
<?php
|
||||
get_template_part("template-components/heading-box--parcours-single", null, array(
|
||||
"parent_title" => $parentTitle,
|
||||
"title" => get_the_title(),
|
||||
"page_icon" => $pageIcon,
|
||||
"published" => get_the_date()
|
||||
));
|
||||
?>
|
||||
<article class="container my-8 mx-auto entry-content single-editor-content <?php echo $thematiqueColorSlug ? "entry-content--" . $thematiqueColorSlug : "" ?>">
|
||||
<?php the_content() ?>
|
||||
</article>
|
||||
</article>
|
||||
|
||||
<!-- PREVIOUS / NEXT ARTICLES -->
|
||||
<div class="previous-next-posts">
|
||||
<?php
|
||||
|
||||
$prev_post = get_previous_post() ?? null;
|
||||
$next_post = get_next_post() ?? null;
|
||||
$prev_thumbnail_url = get_the_post_thumbnail_url($prev_post, 'thumbnail');
|
||||
$prev_page_icon = get_field('step_icon', $prev_post->ID) ?? null;
|
||||
$next_page_icon = get_field('step_icon', $next_post->ID) ?? null;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($next_post) : ?>
|
||||
<a class="previous-next-parcours__next" href="<?php echo get_the_permalink($next_post->ID) ?>">
|
||||
<div class="previous-next-parcours__link-content">
|
||||
<p class="post_denomination"><?php echo __("Étape suivante ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<p class="post_title"><?php echo $next_post->post_title ?></p>
|
||||
</div>
|
||||
<img class="page_icon" src="<?php echo $next_page_icon['url'] ?>" alt="">
|
||||
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($prev_post) : ?>
|
||||
<a class="previous-next-parcours__previous" href="<?php echo get_the_permalink($prev_post->ID) ?>">
|
||||
<img class="page_icon" src="<?php echo $prev_page_icon['url'] ?>" alt="">
|
||||
|
||||
<div class="previous-next-parcours__link-content">
|
||||
<p class="post_denomination"><?php echo __("Étape précédente ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<p class="post_title"><?php echo $prev_post->post_title ?></p>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -42,7 +42,7 @@ $chapterBlockIndex = build_page_chapter_index($blocks); // see utilities.php
|
|||
|
||||
<?php
|
||||
$pageIcon = get_field('page_icon', $archiveParcours->ID);
|
||||
get_template_part("template-components/heading-box--parcours", null, array(
|
||||
get_template_part("template-components/heading-box--parcours-parent", null, array(
|
||||
"pageIcon" => $pageIcon,
|
||||
"subtitle" => __("Parcours rénovateur", "homegrade-theme__texte-fonctionnel"),
|
||||
"title" => get_the_title(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user