Home Forums WoodMart support forum How to add a personal avatar

How to add a personal avatar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #610663

    zhufan122881
    Participant

    Hello
    Is it possible to add a personal avatar to the account information? This will make customer communication in the review area more interesting and lively.
    Thank you!

    Attachments:
    You must be logged in to view attached files.
    #610741

    Hello,

    Try to add the code below in the functions.php file in your child theme:

    function showing_custom_avatar(){
               $current_user = wp_get_current_user();
    
               echo'<div class="myaccount_custom">'.get_avatar($current_user->user_email,72,'',$current_user->display_name). '</div>';
    
        }
    
    add_action( 'woocommerce_account_content','showing_custom_avatar',5);

    Best Regards

    #611107

    zhufan122881
    Participant

    Yes, the avatar is displayed, but for customers, can they edit their own avatar?
    Thank you !

    #611197

    Hello,

    The avatar displayed by this code pulls from the email-associated image, which users can change by updating the email.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)