From bebeb0afffe03d51f294058e62ab1298207fbd41 Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Tue, 12 Mar 2024 23:33:12 +0100 Subject: [PATCH] show in espais associat the convos that belong to them --- template-parts/content-xarxaprod-associat.php | 9 --- template-parts/section-last-convos.php | 76 ++++++++----------- 2 files changed, 31 insertions(+), 54 deletions(-) diff --git a/template-parts/content-xarxaprod-associat.php b/template-parts/content-xarxaprod-associat.php index a119311..25d4185 100644 --- a/template-parts/content-xarxaprod-associat.php +++ b/template-parts/content-xarxaprod-associat.php @@ -90,16 +90,7 @@
- - - - - -
diff --git a/template-parts/section-last-convos.php b/template-parts/section-last-convos.php index b1cd3b2..6bd069c 100644 --- a/template-parts/section-last-convos.php +++ b/template-parts/section-last-convos.php @@ -18,47 +18,32 @@ //plugin is activated do ?>
- - - convos de'.''); - endforeach; - wp_reset_postdata(); - endif; - endif; - ?> + 'xarxaprod-convo', + 'posts_per_page' => '3', + 'meta_query' => array( + array( + 'key' => 'xxp_convo_espai_associat', // name of the custom field + 'value' => '"' . get_the_ID() . '"', // in ACF select Return format "Post ID" + 'compare'=> 'LIKE', // matches exaclty "123", not just 123. This prevents a match for "1234" + ) + ) + ) + ); + ?>

de

- array( 'xarxaprod-convo' ), - 'posts_per_page' => '3', - //'meta_key' => 'xxp_convo_center', - 'meta_key' => 'xxp_convo_espai_associat', - 'meta_value' => $slug_espai_associat, - //'meta_query' => array ( - // 'key' => 'xxp_convo_center', - // 'value' => $slug, - // 'compare' => '=', - //) - ) ); - ?> - -

- -
- - array( 'xarxaprod-convo' ), 'posts_per_page' => '3' ) ); - ?> - + ?> +

+ +
+ + have_posts() ) : ?> have_posts() ) : $convos_query->the_post(); ?> -