From a2ab0d60cf250cfd104565b24187c71a5a8c6b93 Mon Sep 17 00:00:00 2001 From: arminmobasseri Date: Thu, 9 Jan 2025 16:29:52 -0500 Subject: [PATCH] Revert "sql fix attempt" --- .../themes/phila.gov-theme/functions.php | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index dccb1aae7..9a4d0f972 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -61,19 +61,35 @@ function phila_gov_setup() { function phila_register_category_menus() { $get_possible_pages = array( - 'post_type' => array('department_page', 'programs'), - 'posts_per_page' => -1, // Retrieve all posts - 'order' => 'ASC', + 'post_type' => array('department_page', 'programs'), + 'posts_per_page' => -1, + 'order' => 'asc', 'orderby' => 'title', - 'post_status' => 'any', // Exclude 'trash' and 'auto-draft' + 'post_status' => 'any', 'meta_query' => array( - array( - 'key' => 'phila_template_select', - 'value' => array('prog_landing_page', 'homepage_v2', 'homepage_v3', 'department_homepage'), - 'compare' => 'IN', - ) - ) - ); + 'relation' => 'OR', + array( + 'key' => 'phila_template_select', + 'value' => 'prog_landing_page', + 'compare' => '=', + ), + array( + 'key' => 'phila_template_select', + 'value' => 'homepage_v2', + 'compare' => '=', + ), + array( + 'key' => 'phila_template_select', + 'value' => 'homepage_v3', + 'compare' => '=', + ), + array( + 'key' => 'phila_template_select', + 'value' => 'department_homepage', + 'compare' => '=', + ), + ), + ); $query = new WP_Query( $get_possible_pages ); // The Loop