Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagolamonte committed May 8, 2024
2 parents 6e014b7 + 69c9db2 commit 802adca
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions themes/midia-ninja-theme/template-parts/content/post-opiniao.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
<?php

$coauthors = get_coauthors();
$get_coauthors = [];

$has_columnist = false;

foreach( $coauthors as $coauthor ):
$coauthor_data = array();

$coauthor_data['author_id'] = '';
$coauthor_data['colunista'] = '';
if (is_a($coauthor, 'WP_User')) {
$coauthor_data['author_id'] = $coauthor->data->ID;
$coauthor_data['author_name'] = $coauthor->data->display_name;
$coauthor_data['userdata'] = get_userdata( $coauthor_data['author_id'] );
} else {
$coauthor_data['author_id'] = $coauthor->ID;
$coauthor_data['colunista'] = get_post_meta($coauthor_data['author_id'], 'colunista', true);
if( !$has_columnist && $coauthor_data['colunista'] == '1' ){
$has_columnist = true;
}
}
$get_coauthors[] = $coauthor_data;
endforeach;


?>
<a class="post-card post-card-opiniao" href="<?php the_permalink(); ?>">

<div class="post-card--thumb post-opiniao">


<?php if (has_post_thumbnail()) : ?>
<?php if ($get_coauthors[0]['colunista']): ?>
<?php echo get_avatar($get_coauthors[0]['author_id'], 70);?>
<?php elseif (has_post_thumbnail()) : ?>
<?php the_post_thumbnail('medium'); ?>
<?php else : ?>
<img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/images/default-image.png" alt="<?php the_title(); ?>">
<?php endif; ?>


</div><!-- /.post-card--thumb -->

<div class="post-card--content">
Expand Down

0 comments on commit 802adca

Please sign in to comment.