Skip to content

Instantly share code, notes, and snippets.

@nayemDevs
Created November 21, 2020 07:22
Show Gist options
  • Save nayemDevs/e12552793c169359d8f3c7b74faaa444 to your computer and use it in GitHub Desktop.
Save nayemDevs/e12552793c169359d8f3c7b74faaa444 to your computer and use it in GitHub Desktop.
How to show customer avatar on my-account page of WooCommerce
//showing avatar on my-account page
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);
//CSS
.myaccount_custom {
border-right: 1px solid #f99e9e;
float: left;
padding-right: 10px;
margin-right: 10px;
width: 90px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment