224 lines
7.4 KiB
PHP
224 lines
7.4 KiB
PHP
<?php
|
|
|
|
/************/
|
|
/* PAGE FAQ */
|
|
/************/
|
|
?>
|
|
<?php get_header(); ?>
|
|
|
|
|
|
<?php
|
|
$currentThematique = get_queried_object();
|
|
$currentThematiqueIsParent = $currentThematique->parent === 0;
|
|
$mainThematique = getMainThematique($currentThematique);
|
|
$thematiqueColorSlug = getThematiqueFamilySlug($mainThematique->slug);
|
|
|
|
$sousThematiques = get_terms(array(
|
|
'child_of' => $mainThematique->term_id,
|
|
'taxonomy' => 'thematiques',
|
|
'hide_empty' => true,
|
|
));
|
|
?>
|
|
|
|
|
|
<?php
|
|
$query_args = array(
|
|
'post_type' => 'questions',
|
|
'posts_per_page' => -1,
|
|
'status' => 'publish',
|
|
'tax_query' => array(
|
|
array(
|
|
'taxonomy' => 'thematiques',
|
|
'field' => 'term_id',
|
|
'terms' => $currentThematique->term_id,
|
|
)
|
|
)
|
|
);
|
|
$relatedTaxQuestions = new WP_Query($query_args);
|
|
?>
|
|
|
|
|
|
<div class="taxonomy-question-page-container <?php echo $thematiqueColorSlug ? "taxonomy-question-page--" . $mainThematique->slug : "" ?>"" data-thematique-id=" <?php echo $currentThematique->term_id ?>">
|
|
<nav class="breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
|
|
<?php
|
|
$current_children_thematique = get_queried_object()->parent != 0 ? get_queried_object() : null;
|
|
$archiveQuestions = get_page_by_template('template-archive-questions.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($archiveQuestions) ?>"><?php echo $archiveQuestions->post_title ?></a></li>
|
|
|
|
<li>
|
|
<a href="<?php echo get_term_link($mainThematique) ?>" aria-current='location'><?php echo $mainThematique->name ?></a>
|
|
</li>
|
|
<?php if ($current_children_thematique) : ?>
|
|
<li>
|
|
<a href="<?php echo get_term_link($current_children_thematique) ?>"><?php echo $current_children_thematique->name ?></a>
|
|
</li>
|
|
<?php endif; ?>
|
|
|
|
</ol>
|
|
</nav>
|
|
|
|
<?php get_template_part(
|
|
'template-components/posts-components/chapter-header',
|
|
null,
|
|
array(
|
|
'ID' => get_queried_object_id(),
|
|
'title' => __("Les questions les plus fréquentes", "homegrade-theme__texte-fonctionnel__faq-archive-questions"),
|
|
'sub-title' => $currentThematique->name,
|
|
'thematique' => $currentThematique,
|
|
'thematique_generale' => $mainThematique,
|
|
'thematiqueColorSlug' => $thematiqueColorSlug,
|
|
)
|
|
|
|
); ?>
|
|
|
|
<?php if ($mainThematique) : ?>
|
|
|
|
<?php /* -------
|
|
FILTERS
|
|
---------------*/ ?>
|
|
<div class="filters-toolbar filters-toolbar--faq">
|
|
<!-- RESULTS INDICATIONS -->
|
|
<div class="filters-toolbar__posts-results-indications">
|
|
<p class="filters-toolbar__posts-results-amount filter-disable" role="status" aria-live="polite">
|
|
<span class="results-amount">
|
|
<?php echo $relatedTaxQuestions->found_posts ?>
|
|
</span>
|
|
<span class="results-text">
|
|
<?php echo __("résultat(s)", "homegrade-theme__texte-fonctionnel"); ?>
|
|
</span>
|
|
|
|
<span class="results-for">
|
|
<?php echo __("pour", "homegrade-theme__texte-fonctionnel") . " : "; ?>
|
|
</span>
|
|
<span class="results-filter-name">
|
|
<?php echo __("categorie", "homegrade-theme__texte-fonctionnel"); ?>
|
|
</span>
|
|
</p>
|
|
<div class="filters-toolbar__accessibility-action-buttons">
|
|
<button class="filters-toolbar__action-button--load-all" hidden> <?php echo __("Afficher toutes les publications", "homegrade-theme_texte-fonctionnel") ?></button>
|
|
<button class="filters-toolbar__action-button--deploy-all"><?php echo __("Tout déployer", "homegrade-theme_texte-fonctionnel") ?></button>
|
|
<button class="filters-toolbar__action-button--close-all" hidden="true"><?php echo __("Tout fermer", "homegrade-theme_texte-fonctionnel") ?></button>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- THEMATIQUES FILTERS -->
|
|
<div class="action-thematiques-filters-wrapper">
|
|
<div class="filters-toolbar__action-thematiques-filters">
|
|
<button class="filter-by-thematiques-submenu-toggle" aria-expanded="false"><?php echo __("Filtrer par catégories", "homegrade-theme__texte-fonctionnel") ?></button>
|
|
<ul class="action-thematiques-filters-list" hidden aria-hidden>
|
|
<li>
|
|
<input class="filters-toolbar__action-thematiques-filter--show-all" type="checkbox" id="all" name="all" value="all" checked>
|
|
<label for="all"><?php echo __("Tous", "homegrade-theme__texte-fonctionnel") ?></label>
|
|
</li>
|
|
|
|
<?php foreach ($sousThematiques as $sousThematique) : ?>
|
|
|
|
<li>
|
|
<input class="filters-toolbar__action-thematiques-filter" type="checkbox" id="<?php echo $sousThematique->slug ?>" name="<?php echo $sousThematique->slug ?>" value="<?php echo $sousThematique->term_id ?>" data-title="<?php echo $sousThematique->name ?>">
|
|
<label for="<?php echo $sousThematique->slug ?>"><?php echo $sousThematique->name ?></label>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ACTIVE FILTERS VIEWER -->
|
|
<div class="filters-toolbar__active-filters-viewer">
|
|
<div class="active-filters-button-container">
|
|
</div>
|
|
<button class="filters-toolbar__action-button--reset-filter cta cta--button cta--outline" hidden><?php echo __("Réinitialiser le filtre ", "homegrade-theme__texte-fonctionnel") ?></button>
|
|
</div>
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<section class=" post-question-page__accordeons-container ">
|
|
<?php
|
|
get_template_part(
|
|
'template-components/faq/faq-rows',
|
|
null,
|
|
array(
|
|
'relatedTaxQuestions' => $relatedTaxQuestions,
|
|
)
|
|
)
|
|
?>
|
|
|
|
</section>
|
|
<!-- <button id="load-more-questions"><?php echo __("Charger plus de questions", "homegrade-theme__texte-fonctionnel") ?></button> -->
|
|
|
|
|
|
<section class="card-large-content-container">
|
|
|
|
<div class="card-large-content">
|
|
|
|
<div class="section_titling">
|
|
<h2 class="section_titling__title"><?php echo __("Publications suggérées", "homegrade-theme__texte-fonctionnel") ?></h2>
|
|
<p class="section_titling__subtitle"><?php echo __("Consultez notre documentation pour en savoir plus", "homegrade-theme__texte-fonctionnel") ?></p>
|
|
</div>
|
|
|
|
|
|
<ul id="brochures-rows" class="publications-grid">
|
|
<?php
|
|
|
|
$args = array(
|
|
'post_type' => 'brochures',
|
|
'posts_per_page' => 5,
|
|
'post_status' => 'publish',
|
|
'orderby' => 'rand',
|
|
'meta_key' => 'brochure_pdf',
|
|
'meta_value' => false,
|
|
'meta_compare' => '!=',
|
|
'tax_query' => array(
|
|
array(
|
|
'taxonomy' => 'thematiques',
|
|
'field' => 'term_id',
|
|
'terms' => $mainThematique->term_id,
|
|
)
|
|
)
|
|
);
|
|
$brochuresPosts = new WP_Query($args);
|
|
|
|
?>
|
|
<?php
|
|
get_template_part(
|
|
'template-components/archives/brochure-rows',
|
|
null,
|
|
array(
|
|
'brochuresPosts' => $brochuresPosts,
|
|
)
|
|
)
|
|
?>
|
|
</ul>
|
|
|
|
<?php
|
|
$args = array(
|
|
'meta_key' => '_wp_page_template',
|
|
'meta_value' => "template-publications.php"
|
|
);
|
|
$relatedPublicationsTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
|
|
|
|
?>
|
|
<a class="cta cta--button cta--outline cta--centered" href="<?php echo get_the_permalink($relatedPublicationsTemplatePage) ?>"><?php echo __("Consulter toutes les publications ", "homegrade-theme__texte-fonctionnel") ?></a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
get_footer();
|