homegrade_theme_production/template-blocks/home/questions-frequentes/questions-frequentes.php

45 lines
1.2 KiB
PHP

<?php
$block_titling = get_field('block_titling_description_datas');
?>
<section id="block-questions-frequentes">
<div class="section_titling">
<h2 class="section_titling__title">Les questions les plus fréquentes </h2>
<h3 class="section_titling__subtitle">Simplifions votre recherche !</h3>
</div>
<div class="questions-frequentes-grid">
<?php
$thematique_terms = get_terms(array(
'taxonomy' => 'thematiques',
'hide_empty' => false,
'parent' => 0
));
// echo '<pre>';
// print_r($thematique_terms);
// echo '</pre>';
// $thematiques = ['location', 'acoustique'];
foreach ($thematique_terms as $key => $thematique) {
$thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques');
$manual_data = get_field($thematique->slug . '_manual_data');
$post_datas = $manual_data ? $manual_data : get_automatic_post($thematique->slug);
get_template_part(
'template-components/card-frequent-question',
null,
array(
'thematique' => $thematique_datas,
'post_ID' => $post_datas->ID,
'post_title' => $post_datas->post_title,
'post_excerpt' => $post_datas->post_excerpt,
)
);
}
?>
</div>
</section>