How to load locally saved author photos based on author ID

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

Change the avatar ratio?

Possible sollutions: Use Css with something like overflow: hidden; and “cut out” what you need. Use the filter apply_filters(‘get_avatar’, $avatar, $id_or_email, $size, $default, $alt); and override the output of $avatar completely. The function get_avatar() is pluggable. That means if you hook a plugin function early enough that already defines get_avatar() then this function will be … Read more

avatar displays outside of targeted area

There is a native WordPress function to do exactly what it sounds like you’re trying to do. You need to replace userphoto_thumbnail($user_info, $before=””, $after=””, $attributes = array(width => ’40’, height => ’40’), $default_src=””) with get_avatar($user_info->ID,40) Check here for your future reference – http://codex.wordpress.org/Function_Reference/get_avatar

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