Title: Shortcode for user avatar
Last modified: July 1, 2021

---

# Shortcode for user avatar

 *  Resolved [sebnast](https://wordpress.org/support/users/sebnast/)
 * (@sebnast)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/shortcode-for-user-avatar/)
 * Hi, i’ve had a look around the forums and google but can’t find the answer to
   my question.
    Is there a shortcode to display UM user profile pic?
    -  This topic was modified 4 years, 9 months ago by [sebnast](https://wordpress.org/support/users/sebnast/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/shortcode-for-user-avatar/#post-14618480)
 * Hi [@sebnast](https://wordpress.org/support/users/sebnast/)
 * You can try adding the following code snippets to your Theme/Child-Theme’s functions.
   php file or use the Code Snippets plugin to run the code:
 *     ```
       add_shortcode("um_display_avatar","um_070221_avatar_shortcode");
       function um_070221_avatar_shortcode( $atts ) {
       	$atts = extract( shortcode_atts( array(
       		'user_id' => get_current_user_id(),
           ), $atts ) );
           $image = get_usermeta( $user_id , "profile_photo", true);
           return UM()->uploader()->get_upload_user_base_url( $user_id ) ."/" . $image;
   
       }
       ```
   
 * Usage #1: `[um_display_avatar]` – Displays the currently logged-in user’s profile
   photo URL
 * Usage #2: `[um_display_avatar user_id="35"]` – Displays the profile photo URL
   of a specific user.
 * Regards,
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/shortcode-for-user-avatar/#post-14625899)
 * Hey there!
 *  This thread has been inactive for a while so we’re going to go ahead and mark
   it Resolved.
 * Please feel free to re-open this thread by changing the Topic Status to ‘Not 
   Resolved’ if any other questions come up and we’d be happy to help. 🙂
 * Regards,
 *  Thread Starter [sebnast](https://wordpress.org/support/users/sebnast/)
 * (@sebnast)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/shortcode-for-user-avatar/#post-14625970)
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode for user avatar’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 2 participants
 * Last reply from: [sebnast](https://wordpress.org/support/users/sebnast/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/shortcode-for-user-avatar/#post-14625970)
 * Status: resolved