From 9ec63579add04ccc2cb36f6a812d8e98dc864faa Mon Sep 17 00:00:00 2001 From: "Jorge vitrubio.net" Date: Mon, 27 May 2024 16:42:08 +0200 Subject: [PATCH] Revert "changed loop to avoid dates issues" This reverts commit 9cb18552d0742afe746cba250e3d9b6d07dc724a. --- archive-xarxaprod-convo.php | 65 +++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/archive-xarxaprod-convo.php b/archive-xarxaprod-convo.php index cdbeb49..3f02dbe 100644 --- a/archive-xarxaprod-convo.php +++ b/archive-xarxaprod-convo.php @@ -31,6 +31,36 @@ get_header(); + + + + + + + + '=' + // 2. then after today 'compare' => '>' + // + // if done with '>=' outputs + // 1. older dates in asc order + // 2. at the end today + ?> + 'xxp_convo_apply_end', 'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/ - 'compare' => '>=', //show events from today and later + 'compare' => '=', //show events from today and later 'type' => 'DATE', ) ), @@ -56,7 +86,38 @@ get_header(); have_posts() ) : ?> have_posts() ) : $the_query_convo->the_post(); ?> - + + + + + + + 'xarxaprod-convo', + 'posts_per_page' => '-1', //show all + 'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end + 'meta_query' => array( + array( //filter results show only older than today + 'key' => 'xxp_convo_apply_end', + 'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/ + 'compare' => '>', //show events from today and later + 'type' => 'DATE', + ) + ), + 'order_by' => 'meta_value', //order by meta value + 'order' => 'ASC', //order ascendent + ) + ); + ?> + have_posts() ) : ?> + have_posts() ) : $the_query_convo->the_post(); ?> + +