Forum breadcrumbs – You are here:Asgaros Support ForumSupportCustom Avatar
Please or Register to create posts and topics.

Custom Avatar

Hello, great plugin.

My code is as below right now, what I need is another function to change it from after post author into before post author, if that is possible 🙂

<?php
add_action('asgarosforum_after_post_author', 'my_function_asgaros_cabinet', 30, 1);
function my_function_asgaros_cabinet($author_id) { ?>
 <?php echo '<a href="######" title="'.__('Message Privé','rcl-asgaros').'">Send Message</a>'; ?>
 <div class="forum-avatar" style="background: url('<?php echo $iv_profile_pic_url=get_user_meta($author_id, 'iv_profile_pic_url',true);?>') center center no-repeat; background-size: cover;"></div>	
<?php
 }
?>

 

 

Uploaded files:
  • avatarerror.png

Hello @iskall

I suggest you to use the official get_avatar_url filter which allows you to overwrite the avatar-URL which is returned by the get_avatar() function:

get_avatar_url

In this case you dont need to re-implement the avatar-stylings and also dont need to move anything around.

iskall has reacted to this post.
iskall
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

I’m not sure how that works, but I will try to do some research, thank you.