How to display avatar in author.php
-
Hi,
I’ve tried every possibility I can think of to display the avatar in the author.php template but all I get is the empty default avatar, even though I have uploaded a pic in my profile. Please don’t link me to the get_avatar page because I tried everything in that page in my knowledge, and I was unable to display it.
Here is what I have before my loop:
<?php $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); ?> <h2>About: <?php echo $curauth->nickname; ?></h2> <dl> <dt>Website</dt> <dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd> <dt>Profile</dt> <dt><?php get_the_author_meta( $userID ); ?><?php echo get_avatar($id_or_email); ?></dd> </dl> <div class="section-title"> <h4>Posts by <?php echo $curauth->nickname; ?>:</h4> </div>
I’m sure there is something wrong in there, but I can’t seem to figure it out.
Any help would be appreciated, thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to display avatar in author.php’ is closed to new replies.