amr users
[resolved] Change Avatar Output (5 posts)

  1. beanz7890
    Posted 3 years ago #

    I would like to change the way avatars are displayed using this plugin, are you able to advise as to where I would start?

    Rather than display the standard WP avatar or gravatar, I would like to display a custom one. I currently do this in my author.php file with the following:

    $userID = get_the_author_meta('ID');
    $user = get_userdata( $userID );
    $displayName = $user->adi_displayname;
    $photoURL = $user->adt_user_photo_url;
    <img src="<?php echo $photoURL?>" title="Profile photograph for <?php echo $displayName?>" alt="Profile photograph for <?php echo $displayName?>"></img>

    Where would I put this in your plugin?

    Thanks very much.


  2. anmari
    Plugin Author

    Posted 3 years ago #

    Hi beanz,

    plugin uses wordpress avatar function, so recommended way (in general, not just for this plugin) is to use the wordpress get avatar filter to serve up your custom avatar.

    No modification of plugin or wp code required => better maintainability.


  3. beanz7890
    Posted 3 years ago #

    Thanks for coming back to me.

    Which files/where does your plugin make this call?


  4. anmari
    Plugin Author

    Posted 3 years ago #

    Really beanz7890? If you are planning on coding, you should know how to find stuff in code: go to into your editor on one of the amr-user files (hopefully you are using something like notepad++ or sublimetext2 that has a find files feature). Hit find in files (select all amr-users files), type in "get_avatar" and see what comes up.

    Note as I said above it is NOT recommended to modify plugin code - it will remove your site from the upgrade path. That is why filters and pluggable function exist - they make wordpress VERY powerful/customisable while maintaining ability to upgrade.

    The recommended way to modify avatar output is using the filter. A quick google will help you

  5. beanz7890
    Posted 3 years ago #


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • amr users
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.