handling nederland color scheme

This commit is contained in:
Antoine M 2023-10-25 14:45:16 +02:00
parent acef13761a
commit db1b1562d3

View File

@ -36,39 +36,40 @@ function build_chapter_index($blocks)
$currentThematique = get_the_terms(get_the_ID(), 'thematiques')[0];
$mainThematique = getMainThematique($currentThematique);
$thematiqueColorSlug = $mainThematique->slug;
?>
<div class="post-conseil-page-container <?php echo $thematiqueColorSlug ? "post-conseil-page--" . $thematiqueColorSlug : "" ?>"">
<nav class=" breadcrumbs_navigation" aria-label="breadcrumbs">
<?php
$archiveConseils = get_page_by_template('template-archive-conseils.php')[0];
<div class="post-conseil-page-container <?php echo $thematiqueColorSlug ? "post-conseil-page--" . $thematiqueColorSlug : "" ?>">
<nav class=" breadcrumbs_navigation" aria-label="breadcrumbs">
<?php
$archiveConseils = get_page_by_template('template-archive-conseils.php')[0];
?>
<ol>
<li><a href="<?php echo home_url() ?>">Home</a></li>
<li><a href="<?php echo get_post_permalink($archiveConseils) ?>"><?php echo $archiveConseils->post_title ?></a></li>
<?php if ($mainThematique != $currentThematique) : ?>
<?php
$args = array(
'post_type' => 'conseils', // the post type
'tax_query' => array(
array(
'taxonomy' => 'thematiques', // the custom vocabulary
'field' => 'term_id', // term_id, slug or name
'terms' => array($mainThematique->term_id),
'include_children' => false,
?>
<ol>
<li><a href="<?php echo home_url() ?>">Home</a></li>
<li><a href="<?php echo get_post_permalink($archiveConseils) ?>"><?php echo $archiveConseils->post_title ?></a></li>
<?php if ($mainThematique != $currentThematique) : ?>
<?php
$args = array(
'post_type' => 'conseils', // the post type
'tax_query' => array(
array(
'taxonomy' => 'thematiques', // the custom vocabulary
'field' => 'term_id', // term_id, slug or name
'terms' => array($mainThematique->term_id),
'include_children' => false,
),
),
),
);
$mainThematiqueRelatedConseil = get_posts($args)[0] ?? null;
?>
<li><a href="<?php echo get_post_permalink($mainThematiqueRelatedConseil) ?>"><?php echo $mainThematique->name ?></a></li>
);
$mainThematiqueRelatedConseil = get_posts($args)[0] ?? null;
?>
<li><a href="<?php echo get_post_permalink($mainThematiqueRelatedConseil) ?>"><?php echo $mainThematique->name ?></a></li>
<?php endif; ?>
<li><a href="<?php echo the_permalink() ?>" aria-current="location"><?php echo $currentThematique->name ?></a></li>
<?php endif; ?>
<li><a href="<?php echo the_permalink() ?>" aria-current="location"><?php echo $currentThematique->name ?></a></li>
</ol>
</ol>
</nav>
<?php