How to upload WP user avatar on woocommerce account page [closed]

Ok, now it’s time to get your hands dirty. Open up your functions.php file located in wp-content/themes/your-theme-name/ and add this code in it: /** * Print the customer avatar in My Account page, after the welcome message */ function storefront_myaccount_customer_avatar() { $current_user = wp_get_current_user(); echo ‘<div class=”myaccount_avatar”>’ . get_avatar( $current_user->user_email, 72, ”, $current_user->display_name ) . … Read more

Gravatar – Default IMG

Your code actually works, it is just that you can’t do what you want. The way gravatar works is by serving the image if it has one and redirecting to the supplied default if it doesn’t, so even if the default is on your server you still can’t avoid the redirect. And gravatar really makes … Read more

How can I display other user avatars on an author profile page?

Have you tried to specify the $userID parameter of get_the_author_meta(), like shown below: echo get_avatar(get_the_author_meta( ‘ID’, $post->post_author ), 150); This uses the post_author key from your secondary query, which has the ID as value, that said you should be able to shorten your code to: echo get_avatar( $post->post_author, 150);

How to set custom avatar for users?

We can use the get_avatar_url filter to modify the avatar’s url. If all the relevant get_avatar() calls, have user id as an input argument, then it’s easy to get the corresponding user’s meta value, with get_user_meta(), within the filter’s callback. Otherwise we need to handle all possible input cases, for get_avatar( $some_input ), as it … Read more

Buddypress update user avatar image via REST

I finally found a SOLUTION and i want to post it because can be useful for someone! public function update_user_avatar() { global $json_api; if (!$json_api->query->user_id) { $json_api->error(“Missing ‘user_id’ parameter.”); } if (!$json_api->query->image) { $json_api->error(“Missing ‘image’ parameter.”); } $user_id = $json_api->query->user_id; $base64 = $json_api->query->image; $imgdata = base64_decode($base64); $f = finfo_open(); $mime_type = finfo_buffer($f, $imgdata, FILEINFO_MIME_TYPE); $type_file … Read more

How do I accesss gravatar?

The only place that gravatars are administered in WordPress core (without plugins, that is) is on the discussion settings page: If you want to access YOUR gravatar, go to http://gravatar.com and set up your profile. WordPress is set to automatically interface with gravatar using your user’s email address to identify you with gravatar.com.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)