0

I have downloaded WP User Avatar plugin, to add the functionality to create your own avatars for users. I was wondering if it is possible to show for each user the avatar in my theme markup. How can I do this?

0

I've used this plugin in the past and have done this in the past.

$blogusers = get_users_of_blog();
if ($blogusers):
   foreach ($blogusers as $bloguser):
      $user = get_userdata($bloguser->user_id);

      <a href="<?php get_author_posts_url($user->ID); ?>">
         get_avatar($user->ID, 70);  // 70 is the size of the avatar
      </a>

      if(!empty($user->user_firstname)):
        <h4>
          <a href="<?php get_author_posts_url($user->ID); ?>">
            <?php echo $user->user_firstname . ' ' . $user->user_lastname; ?>
          </a>
        </h4>
      endif;
   endforeach;
   wp_reset_query();
endif;

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.