From 44a6c0ef032b30909aec91e7d49727d2f39c7900 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 24 Feb 2026 15:08:18 +0100 Subject: [PATCH] FEATURE Handling a variation for the post type analyse-etude post types to get the two last analyse and etude with a dedicated function --- template-parts/components/archive/latest-parutions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/template-parts/components/archive/latest-parutions.php b/template-parts/components/archive/latest-parutions.php index 9aae8bc..bba85fb 100644 --- a/template-parts/components/archive/latest-parutions.php +++ b/template-parts/components/archive/latest-parutions.php @@ -10,6 +10,12 @@ $posts_query = new WP_Query(array( 'order' => 'DESC', )); + +if ($post_type === 'analyses-etudes') : + $posts_query = get_last_analyses_etudes_posts(); +endif; + + $posts = $posts_query->posts; $current_post_type = $args['current_post_type'] ?? get_post_type(); @@ -24,8 +30,8 @@ $current_post_type = $args['current_post_type'] ?? get_post_type(); - get_the_ID(), + $post->ID, )); ?> \ No newline at end of file