get_avatar() for guest author
-
When using the WP function
get_avatar($coauthor->ID, 100)
the avatar displays the default avatar image instead of the image set inguest authors
, seem to work fine when the user is a contributor, subscriber, editor, etc.<?php if (function_exists('get_coauthors')) : ?> <?php $coauthors = get_coauthors(); ?> <?php foreach ($coauthors as $coauthor) : ?> <div class="row post__author"> <div class="col-12 col-md-auto d-flex"> <figure class="post__author--image"> <?= get_avatar($coauthor->ID, 100); ?> </figure> <h5 class="post__author--name d-inline-block d-md-none"><?= $coauthor->display_name; ?></h5> <div class="col post__author--bio"> <h5 class="post__author--name d-none d-md-block"><?= $coauthor->display_name; ?></h5> <?php if ($coauthor->description) echo $coauthor->description; ?> </div> </div> </div> <?php endforeach; ?> <?php endif : ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_avatar() for guest author’ is closed to new replies.