diff --git a/includes/utilities.php b/includes/utilities.php index 69f0591..4eac814 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -128,12 +128,11 @@ function compareThematiquePriority($postA, $postB) $priorityA = $postA->thematique_priority ?? 0; $priorityB = $postB->thematique_priority ?? 0; + $thematiqueA = getPostMainThematique($postA); + $thematiqueB = getPostMainThematique($postB); + if ($priorityA == $priorityB) { - if ($postA->post_date > $postB->post_date) { - return -1; - } else { - return 1; - } + return strcmp($thematiqueA->name, $thematiqueB->name); } if ($priorityA < $priorityB) { return 1;