Skip to content

Commit

Permalink
Ajusta imagem de autor em posts relacionados em single de opinião
Browse files Browse the repository at this point in the history
  • Loading branch information
Thayná Zacharias committed Jan 21, 2025
1 parent a167207 commit a4a4cf0
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@
}
// Exibe os posts encontrados
foreach ($related_posts as $post) :

$coauthors = get_coauthors($post);
?>

<div class="related-post-card">

<a class="related-post-image" href="<?php the_permalink($post); ?>">
<?php
if (has_post_thumbnail($post)) {
echo get_the_post_thumbnail($post);

if (!empty($coauthors) && $coauthors[0]) {
echo coauthors_get_avatar( $coauthors[0], 170 );
} else {
echo '<img src="' . get_stylesheet_directory_uri() . '/assets/images/default-image.png">';
}
Expand All @@ -75,7 +77,6 @@
</a>
<?php
// Exibe os nomes dos co-autores
$coauthors = get_coauthors($post);
foreach ($coauthors as $coauthor) {
echo '<h5>' . esc_html($coauthor->display_name) . '</h5>';
}
Expand Down

0 comments on commit a4a4cf0

Please sign in to comment.