From 4cfe406faae50f17631c0cd57bfdc3f236742171 Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Thu, 3 Oct 2024 17:47:23 -0400 Subject: [PATCH 1/3] Only run tag check if not on the latest --- .../partials/posts/post-grid.php | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php index 66faedf7a..0dcc3cb9c 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php @@ -4,13 +4,18 @@ * */ ?> - - - - 'english', 'compare' => '=', ), - array( - 'key' => 'phila_select_language', - 'compare' => 'NOT EXISTS' - ), ), ) ); @@ -129,10 +130,10 @@ set_transient( get_the_ID().'_empty_posts_results', $result, 1 * HOUR_IN_SECONDS ); } - + //if sticky posts is empty, don't add it to the results array $result->posts = array_merge(isset($sticky_posts->posts) ? $sticky_posts->posts : array(), $more_posts->posts); - + } $result->post_count = count( $result->posts ); @@ -208,7 +209,7 @@ $see_all_URL = array( 'URL' => '/the-latest/archives/?tag=' . $term, ); - else: + else: $term = get_term($tag, 'post_tag'); $see_all_URL = array( 'URL' => '/the-latest/archives/?tag=' . $term->name, From 3996024ca3903224ecdb4b9ef7691d20f774c447 Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Thu, 3 Oct 2024 17:48:06 -0400 Subject: [PATCH 2/3] Remove checks for unset languages --- .../posts/post-translated-langs-see-all.php | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-translated-langs-see-all.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-translated-langs-see-all.php index 1d65f7a9e..56311fbc1 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-translated-langs-see-all.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-translated-langs-see-all.php @@ -1,6 +1,6 @@ - 'english', 'compare' => '!=', ), - array( - 'key' => 'phila_select_language', - 'value' => '', - 'compare' => '!=', - ), ), ) ); @@ -54,11 +49,6 @@ 'value' => 'english', 'compare' => '!=', ), - array( - 'key' => 'phila_select_language', - 'value' => '', - 'compare' => '!=', - ), ), ) ); @@ -67,11 +57,11 @@ $is_translated = new WP_Query( $translations ); $langs = array(); - while ( $is_translated->have_posts() ) : $is_translated->the_post(); + while ( $is_translated->have_posts() ) : $is_translated->the_post(); $lang = rwmb_meta('phila_select_language', '', $post->ID); $langs[$lang] = $lang; endwhile; - + $unique_langs = phila_order_languages(array_unique($langs)); if (!empty($tag)) { @@ -90,7 +80,7 @@

Posts