From 62e087dd80ca8b7d0bca555855df1572ddf566dd Mon Sep 17 00:00:00 2001 From: "Jorge vitrubio.net" Date: Thu, 18 Apr 2024 19:24:55 +0200 Subject: [PATCH] changed loops in archive category and convos, ajut, agenda to properly show today and future content --- archive-xarxaprod-ajut.php | 84 ++++++++++++++++++++++----- archive-xarxaprod-convo.php | 62 +++++++++++++++----- archive.php | 79 ++++++++++++++++++++----- page-templates/arxiu-general.php | 2 +- page-templates/convos-search.php | 5 +- template-parts/section-each-entry.php | 35 +++++++++++ template-parts/section-each-faq.php | 37 ++++++++++++ 7 files changed, 255 insertions(+), 49 deletions(-) create mode 100644 template-parts/section-each-entry.php create mode 100644 template-parts/section-each-faq.php diff --git a/archive-xarxaprod-ajut.php b/archive-xarxaprod-ajut.php index 06a0525..c947600 100644 --- a/archive-xarxaprod-ajut.php +++ b/archive-xarxaprod-ajut.php @@ -31,22 +31,78 @@ get_header(); + '=' + // 2. then after today 'compare' => '>' + // + // if done with '>=' outputs + // 1. older dates in asc order + // 2. at the end today + ?> - - 'xarxaprod-ajut', + 'posts_per_page' => '-1', + 'meta_key' => 'xxp_fund_apply_end', // order by meta key convo apply end + 'meta_query' => array( + array( //filter results show only older than today + 'key' => 'xxp_fund_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', + ) + ), + //https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters + 'orderby' => 'meta_value', //order by meta value + 'order' => 'ASC', //order ascendent + ) + ); + ?> + have_posts() ) : ?> + have_posts() ) : $the_query_ajut->the_post(); ?> + + + + + + + 'xarxaprod-ajut', + 'posts_per_page' => '-1', + 'meta_key' => 'xxp_fund_apply_end', // order by meta key convo apply end + 'meta_query' => array( + array( //filter results show only older than today + 'key' => 'xxp_fund_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', + ) + ), + //https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters + 'orderby' => 'meta_value', //order by meta value + 'order' => 'ASC', //order ascendent + ) + ); + ?> + have_posts() ) : ?> + have_posts() ) : $the_query_ajut->the_post(); ?> + + + + + + - the_posts_navigation(); - - else : - - get_template_part( 'template-parts/content', 'none' ); - - endif; - ?>
diff --git a/archive-xarxaprod-convo.php b/archive-xarxaprod-convo.php index 3bf1ba3..f9a42aa 100644 --- a/archive-xarxaprod-convo.php +++ b/archive-xarxaprod-convo.php @@ -21,6 +21,7 @@ get_header();