Viewing 1 replies (of 1 total)
  • I apologize for the confusion. It seems that the shortcode is currently outputting the HTML code for the avatar image tag instead of rendering the actual image. To display the avatar image instead of the HTML code, you need to modify the code slightly.

    Here’s an updated version of the code:

    function show_user_avatar() {
    global $current_user;
    get_currentuserinfo();
    return get_avatar($current_user->ID, 64);
    }
    add_shortcode(‘avatar’, ‘show_user_avatar’);

Viewing 1 replies (of 1 total)
  • The topic ‘Does not work for me (WP 6.2)’ is closed to new replies.