FEATURE Introducing the component
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nonimart 2025-06-25 11:45:25 +02:00
parent 86fd29864c
commit 2f495878c3

View File

@ -0,0 +1,33 @@
<?php
$postId = $args['postId'];
$authors = [];
$isArticle = is_singular('articles');
if ($isArticle) {
$authors = get_field('authors', $postId);
} else {
$authors = getRevueAuthors($postId);
}
if (empty($authors)) return;
$authorsLastPosts = get_posts(array(
'post_type' => $isArticle ? 'articles' : 'revues',
'author' => $authors,
'posts_per_page' => 6,
'orderby' => 'date',
'order' => 'DESC',
));
?>
<?php foreach ($authorsLastPosts as $post) : ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
'ID' => $post->ID,
)); ?>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>