From 594cfc35b4857a111eb7f210b5deb6ea3da3f19e Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 23 Jul 2024 11:34:31 +0200 Subject: [PATCH] adapting mede-eigendommen slug --- includes/utilities.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/includes/utilities.php b/includes/utilities.php index 15c0b06..21f6ae4 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -10,6 +10,7 @@ function getThematiqueFamilySlug($thematique_slug) if (!$thematique_slug) { return null; } + switch ($thematique_slug) { case "energie": case "urbanisme": @@ -20,7 +21,7 @@ function getThematiqueFamilySlug($thematique_slug) case "akoestiek": case "petites-coproprietes": case "coproprietes": - case "kleine-mede-eigendommen": + case "mede-eigendommen": return "acoustique-coproprietes"; case "isolation": @@ -267,3 +268,22 @@ function build_page_chapter_index($blocks) } return $chapterBlockIndex; } + +/* ------------------------------------------- + GET PARCOURS PREVIOUS/NEXT POSTS + ---------------------------------------------*/ + +function get_parcours_previous_next_posts($post) +{ + + $prev_post = get_previous_post() ?? null; + $next_post = get_next_post() ?? null; + $test_next = get_adjacent_post(false, '', false, 'thematiques'); + $test = new WP_Query(array('orderby' => 'menu_order', 'order' => 'ASC')); + + return [ + 'prev_post' => $prev_post, + 'next_post' => $next_post, + 'test' => $test_next + ]; +}