• Resolved radzio1615

    (@radzio1615)


    Hi!

    I want to use [mycred_content_buyer_avatars] shortcode, but how to add a buddypress profile link and a title attribute to a user’s avatar?

    This is what the code looks like:

    <div class="mycred-sell-this-buyers">
    <img alt="" src="../bp-core/images/mystery-man.jpg" srcset="../bp-core/images/mystery-man.jpg 2x" class="avatar avatar-100 photo" height="100" width="100" loading="lazy">
    </div>

    This is what I want the code to look like:

    <div class="mycred-sell-this-buyers">
    <a href="../users/admin" title="Admin"><img alt="" src="../bp-core/images/mystery-man.jpg" srcset="../bp-core/images/mystery-man.jpg 2x" class="avatar avatar-100 photo" height="100" width="100" loading="lazy"></a>
    </div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @radzio1615,

    Thank you for contacting us, Please use the below-shared code also do let us know how is it working for you.

    add_filter( 'mycred_sell_content_buyer_avatar', 'modify_mycred_sell_content_buyer_avatar', 10, 3 );
    function modify_mycred_sell_content_buyer_avatar( $avatar, $buyer_id, $post_id ) {
        return '<a href="../users/admin" title="Admin">'.$avatar.'</a>';
    }
    Thread Starter radzio1615

    (@radzio1615)

    Thank you, it works perfect!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add profile link and tooltip to buyers’ avatars?’ is closed to new replies.