refactoring for better local handling
This commit is contained in:
parent
ec31f19d44
commit
374b459ff1
|
|
@ -1,7 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
$block_titling = get_field('block_titling_description_datas');
|
$block_titling = get_field('block_titling_description_datas');
|
||||||
|
|
||||||
|
if (!function_exists('get_automatic_post')) {
|
||||||
|
function get_automatic_post($post_thematique)
|
||||||
|
{
|
||||||
|
$automatic_query_args = array(
|
||||||
|
'post_per_page' => 1,
|
||||||
|
'post_status' => 'publish',
|
||||||
|
'post_type' => 'questions',
|
||||||
|
'thematiques' => $post_thematique,
|
||||||
|
'include_children' => true,
|
||||||
|
|
||||||
|
);
|
||||||
|
return get_posts($automatic_query_args)[0] ?? null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
@ -16,11 +29,15 @@ $block_titling = get_field('block_titling_description_datas');
|
||||||
'taxonomy' => 'thematiques',
|
'taxonomy' => 'thematiques',
|
||||||
'hide_empty' => false,
|
'hide_empty' => false,
|
||||||
'parent' => 0
|
'parent' => 0
|
||||||
|
|
||||||
));
|
));
|
||||||
|
|
||||||
foreach ($thematique_terms as $key => $thematique) {
|
foreach ($thematique_terms as $key => $thematique) {
|
||||||
if ($thematique->slug === "renovation-circulaire") continue;
|
if (
|
||||||
|
$thematique->slug === "renovation-circulaire"
|
||||||
|
|| $thematique->slug === "circulaire-renovatie"
|
||||||
|
|| $thematique->slug === "au-quotidien"
|
||||||
|
|| $thematique->slug === "dagelijks"
|
||||||
|
) continue;
|
||||||
|
|
||||||
// $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques');
|
// $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user