Using a function written in my functions.php file within the header.php file
As discussed in comments you actually just want the URL. Here’s your code modified to be a get_avatar_url hook instead: add_filter(‘get_avatar_url’, ‘lb_acf_profile_avatar_url’, 10, 5); function lb_acf_profile_avatar_url($url, $id_or_email, $args) { $user=””; // Get user by id or email if (is_numeric($id_or_email)) { $id = (int) $id_or_email; $user = get_user_by(‘id’, $id); } elseif (is_object($id_or_email)) { if (!empty($id_or_email->user_id)) { … Read more