From dbe3083b116bb52b1a7a45002bda7ab1a1170ee2 Mon Sep 17 00:00:00 2001 From: "Jorge vitrubio.net" Date: Mon, 8 Apr 2024 09:57:08 +0200 Subject: [PATCH] added filter by end date of activitat --- page-templates/agenda-search.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/page-templates/agenda-search.php b/page-templates/agenda-search.php index 8fa1057..0c469b6 100644 --- a/page-templates/agenda-search.php +++ b/page-templates/agenda-search.php @@ -57,18 +57,18 @@ get_header(); 'field' => 'slug', 'terms' => 'activitats' ) - ) + ), //'order_by' => 'meta_value', //order by meta value //'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end - //'order' => 'ASC', //order ascendent - //'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 before today - // 'type' => 'DATE', - // ) - //) + 'order' => 'ASC', //order ascendent + 'meta_query' => array( + array( //filter results show only older than today + 'key' => 'xxp_agenda_date_end', + 'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/ + 'compare' => '>=', //show events before today + 'type' => 'DATE', + ) + ) ) ); ?>