refining page
This commit is contained in:
parent
c4f91ebfc3
commit
21d133bddd
|
|
@ -77,87 +77,80 @@ $relatedTaxQuestions = new WP_Query($query_args);
|
|||
)
|
||||
|
||||
); ?>
|
||||
<section class=" post-question-page__accordeons-container ">
|
||||
<?php if ($mainThematique && $sousThematiques) : ?>
|
||||
<?php
|
||||
|
||||
?>
|
||||
<!-- <div class=" thematiques_filters">
|
||||
<?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"><?php echo __("Filtrer par catégories", "homegrade-theme__texte-fonctionnel") ?></button>
|
||||
<ul class="action-thematiques-filters-list" 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>
|
||||
|
||||
<nav class="thematiques-subtaxonomy-links" aria-label="breadcrumbs">
|
||||
<h3><?php echo __("Filtrer par catégories", "homegrade-theme__texte-fonctionnel") ?></h3>
|
||||
<ul>
|
||||
<?php foreach ($sousThematiques as $sousThematique) : ?>
|
||||
<li data-filter="<?php echo $sousThematique->slug ?>">
|
||||
<button class="cta cta--outline cta--button text-<?php echo $sousThematique->slug ?>"><?php echo $sousThematique->name ?></button>
|
||||
|
||||
<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>
|
||||
<h2 aria-live=" polite"><?php echo __("Nombre de résultats", 'homegrade-theme__texte-fonctionnel') . " : " . count($relatedTaxQuestions->posts) ?></h2>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<?php endif; ?>
|
||||
<!-- 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; ?>
|
||||
|
||||
<?php if ($relatedTaxQuestions->have_posts()) : while ($relatedTaxQuestions->have_posts()) : $relatedTaxQuestions->the_post(); ?>
|
||||
<?php
|
||||
<section class=" post-question-page__accordeons-container ">
|
||||
<?php
|
||||
get_template_part(
|
||||
'template-components/faq/faq-rows',
|
||||
null,
|
||||
array(
|
||||
'relatedTaxQuestions' => $relatedTaxQuestions,
|
||||
)
|
||||
)
|
||||
?>
|
||||
|
||||
$questionCurrentSubthematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
|
||||
$relatedFichesConseilsSubThematiqueQuery = new WP_Query(array(
|
||||
'post_type' => 'conseils',
|
||||
'posts_per_page' => 1,
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'thematiques',
|
||||
'field' => 'term_id',
|
||||
'terms' => $questionCurrentSubthematique->term_id,
|
||||
)
|
||||
)
|
||||
));
|
||||
$relatedFichesConseilsThematiqueQuery = new WP_Query(array(
|
||||
'post_type' => 'conseils',
|
||||
'posts_per_page' => 1,
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'thematiques',
|
||||
'field' => 'term_id',
|
||||
'terms' => $mainThematique->term_id,
|
||||
)
|
||||
)
|
||||
));
|
||||
$relatedFicheConseil = $relatedFichesConseilsSubThematiqueQuery->posts[0] ?? $relatedFichesConseilsThematiqueQuery->posts[0] ?? null;
|
||||
|
||||
// $test = $relatedSubThematiqueQuery->posts[0] ??
|
||||
echo '<pre>';
|
||||
// print_r($questionCurrentSubthematique);
|
||||
// print_r($relatedFichesConseilsSubThematiqueQuery->posts[0]->ID);
|
||||
// print_r($relatedSubThematiqueConseil->posts[0]->ID);
|
||||
echo '</pre>';
|
||||
|
||||
?>
|
||||
<details class=" question">
|
||||
<summary>
|
||||
<?php the_title(); ?>
|
||||
<div class="open-close-icon">
|
||||
<img src="<?php echo get_template_directory_uri() . '/resources/img/graphic-assets/chevron_down.svg' ?>" class="open-close-cta" alt="" />
|
||||
</div>
|
||||
</summary>
|
||||
<div class="content entry-content">
|
||||
<?php the_content(); ?>
|
||||
<?php if ($relatedFicheConseil) : ?>
|
||||
<div class="question-context">
|
||||
<p class="question-context__title"><?php echo __("Ce contenu fait parti de ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<a class="question-context__conseil-name" href="<?php echo get_permalink($relatedFicheConseil) ?>">
|
||||
<?php echo $relatedFicheConseil->post_title ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<?php endwhile ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<!-- <button id="load-more-questions"><?php echo __("Charger plus de questions", "homegrade-theme__texte-fonctionnel") ?></button> -->
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user