FEATURE Completion of main behaviours

This commit is contained in:
Nonimart 2025-06-25 12:28:43 +02:00
parent 15487c8891
commit 3ef493e118

View File

@ -8,8 +8,6 @@ if ($isArticle) {
} else { } else {
$authors = getRevueAuthors($postId); $authors = getRevueAuthors($postId);
} }
if (empty($authors)) return; if (empty($authors)) return;
$authorsLastPosts = get_posts(array( $authorsLastPosts = get_posts(array(
@ -19,15 +17,23 @@ $authorsLastPosts = get_posts(array(
'orderby' => 'date', 'orderby' => 'date',
'order' => 'DESC', 'order' => 'DESC',
)); ));
if (empty($authorsLastPosts)) return;
?> ?>
<div class="authors-last-publications">
<?php if (count($authors) <= 1) : ?>
<h3 class="title-small">Ses dernières publications</h3>
<?php else : ?>
<h3 class="title-small">Leurs dernières publications</h3>
<?php endif; ?>
<?php foreach ($authorsLastPosts as $post) : ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
<?php foreach ($authorsLastPosts as $post) : ?> 'ID' => $post->ID,
<?php get_template_part('template-parts/articles/card-article', null, array( 'showAuthors' => true,
'ID' => $post->ID, )); ?>
)); ?> <?php endforeach; ?>
<?php endforeach; ?> </div>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>