Hey!
You can use the following code to add avatars to the leaderbaord. Each results row is passed though the mycred_ranking_row filter which allows you to add / adjust things that can not be done via the template.
add_filter( 'mycred_ranking_row', 'my_custom_ranking_rows', 10, 4 );
function my_custom_ranking_rows( $layout, $template, $row, $position )
{
return str_replace( '%avatar%', get_avatar( $row['user_id'], 32 ), $layout );
}
This code goes in your themes functions.php file and introduces a new template tag called %avatar% which will be replaced by the users avatar.
But that code only works for the leaderboard so to add support for balances, we would be better off registering this new template tag as a user related tag which means that everywhere where User related template tags can be used, this new tag will also be available. To do this, we will need to use the mycred_parse_tags_user filter.
Example:
add_filter( 'mycred_parse_tags_user', 'custom_general_template_tag', 10, 3 );
function custom_general_template_tag( $content, $user, $data ) {
// Bail if user no longer exists
if ( ! isset( $user->ID ) ) return $content;
return str_replace( '%avatar%', get_avatar( $user->ID, 32 ), $content );
}
Let me know if you require further assistance.