From 115bc14ff7ef611f3d18fe5b4e6725236b55dac6 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 24 Feb 2026 17:27:59 +0100 Subject: [PATCH] FEATURE introducing component --- .../authors/authors-last-publications.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 template-parts/authors/authors-last-publications.php diff --git a/template-parts/authors/authors-last-publications.php b/template-parts/authors/authors-last-publications.php new file mode 100644 index 0000000..98e471c --- /dev/null +++ b/template-parts/authors/authors-last-publications.php @@ -0,0 +1,51 @@ + 'OR'); +foreach ($authors as $author) { + $meta_query[] = array( + 'key' => 'authors', + 'value' => '"' . $author->ID . '"', // Recherche la valeur sérialisée + 'compare' => 'LIKE' + ); +} + + +$authorsLastPosts = get_posts(array( + 'post_type' => $isArticle ? 'articles' : 'revues', + 'posts_per_page' => 6, + 'orderby' => 'date', + 'order' => 'DESC', + 'meta_query' => $meta_query, +)); + +if (empty($authorsLastPosts) || count($authorsLastPosts) < 2) return; +?> + +
+ +

Ses dernières publications

+ +

Leurs dernières publications

+ + + + $post->ID, + 'showAuthors' => true, + )); ?> + +
+ + \ No newline at end of file