104 lines
3.4 KiB
PHP
104 lines
3.4 KiB
PHP
<?php /* Template Name: Parcours rénovateur */
|
|
get_header();
|
|
|
|
$parcoursSteps = new WP_Query(array(
|
|
'post_type' => 'parcours',
|
|
'posts_per_page' => -1,
|
|
'order' => 'ASC',
|
|
'status' => 'publish',
|
|
'post_parent' => '0',
|
|
));
|
|
|
|
|
|
?>
|
|
|
|
<div class="homegrade-page-container homegrade-page-container--parcours-renovateur-index">
|
|
|
|
<?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;
|
|
$grandParentPage = $parentPage && $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" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
|
|
<?php endif; ?>
|
|
|
|
</ol>
|
|
</nav>
|
|
|
|
<?php
|
|
$page_icon = get_field('page_icon', get_queried_object());
|
|
$pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|
|
|
get_template_part("template-components/heading-box", null, array(
|
|
"pageIcon" => $pageIcon,
|
|
"title" => get_the_title(),
|
|
"description" => __("Toutes les étapes à connaître pour rénover votre logement.", "homegrade-theme__texte-fonctionnel"),
|
|
|
|
));
|
|
?>
|
|
|
|
|
|
<section class="parcours-steps-container">
|
|
|
|
<?php foreach ($parcoursSteps->posts as $parcoursStep) : ?>
|
|
<div class="parcours-steps-container__step card">
|
|
<?php
|
|
$childrenStepPosts = get_posts(array(
|
|
'post_type' => 'parcours',
|
|
'posts_per_page' => -1,
|
|
'status' => 'publish',
|
|
'order' => 'menu_order',
|
|
'post_parent' => $parcoursStep->ID,
|
|
));
|
|
|
|
|
|
$stepIcon = get_field('step_icon', $parcoursStep->ID);
|
|
?>
|
|
<img class="step-icon" src="<?php echo $stepIcon['url'] ?>" alt="">
|
|
<h2><?php echo $parcoursStep->post_title ?></h2>
|
|
<p><?php echo $parcoursStep->post_excerpt ?> </p>
|
|
|
|
<?php foreach ($childrenStepPosts as $childPost) : ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<a class="cta cta--en-savoir-plus " href="<?php echo get_permalink($parcoursStep->ID) ?>">
|
|
<?php echo __("En savoir plus ", "homegrade-theme__texte-fonctionnel") ?>
|
|
<div class="cta_arrow_button">
|
|
<img src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/arrow-right-circle.svg' alt=''>
|
|
</div>
|
|
</a>
|
|
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
</section>
|
|
|
|
|
|
<?php
|
|
the_content();
|
|
?>
|
|
<?php endwhile; ?>
|
|
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php get_footer();
|