Adding custom avatar field to comments
There are some plugins that do this functionality of adding the Twitter avatar as the default user Avatar for WordPress, Twitter Avatar Reloaded Add Local Avatar
There are some plugins that do this functionality of adding the Twitter avatar as the default user Avatar for WordPress, Twitter Avatar Reloaded Add Local Avatar
The get_avatar function returns the Gravatar wrapped in <img> tags. In your case you’ll want to use get_avatar_url to get just the URL of the image you need. Combine that with WordPress’ wp_remote_get and you can grab the image data into a variable or save it as an image. $user = wp_get_current_user(); $gravatar_url = get_avatar_url( … Read more
You can try this one: function wp_ste_add_nopin_args( $args ) { $extra_attr=”nopin=”nopin””; $args[‘extra_attr’] = $extra_attr; return $args; } add_filter( ‘get_avatar_data’, ‘wp_ste_add_nopin_args’, 999, 1 ); For further reading, please visit: https://developer.wordpress.org/reference/functions/get_avatar_data/
How to add avatar to authors list?
One option is to use the pre_get_avatar filter to return custom avatar HTML, which will short-circuit get_avatar() preventing it from reaching out to Gravatar for the image. For example like this, add_filter(‘pre_get_avatar’, ‘wpse_410434_author_img_html’, 10, 3); function wpse_410434_author_img_html( $avatar, $id_or_email, $args ) { if ( $avatar || ! is_numeric( $id_or_email ) ) { return $avatar; } … Read more
1 Visit Gravatar website 2 Sign in to Gravatar with your WordPress.com account. If you don’t have a WordPress.com account then you need to create one. 3 Upload your avatar ( profile picture ). and you are done with it.
If you look at the Gravatar API you will see that you can call a user specific and specify a default so here a built proof way to get the the image url in your code. $email = $comment->comment_author_email; $size = 60; $rating = get_option(‘avatar_rating’); $default = urlencode( ‘http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=” . $size ); $grav_url = “http://www.gravatar.com/avatar/’. … Read more
Developer Tools show a “bad request” error, so switch to the twentyeleven theme to be sure it’s not a theme issue. And disable the W3TC plugin and see if anything changes.
The point is, that the format have no tags for a image to a user. You must use a other tag to inlcude the avatar of a author, not the author tag. The author tag is only for a string, not markkup or images. But you can add content ot the desciption and this is … Read more
<?php $product_pages_args = array( ‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => ‘page_library_html_content.php’, ‘hierarchical’ => ‘0’ ); $product_pages = get_pages( $product_pages_args ); ?> <?php foreach ( $product_pages as $product_page ) { $author_id = get_post_field(‘post_author’, $product_page->ID ); $author_details = get_user_by( ‘id’, $author_id ); $author_name = $author_details->first_name . ‘ ‘ . $author_details->last_name; echo ‘<div id=”posts” class=”flex_100″>’; echo ‘<div id=”library_title”><a href=”‘ … Read more