27 thoughts on “Custom user avatar in wordpress

    • November 7, 2014 at 5:37 am
      Permalink

      Hi Bahman,
      you can get it by using following:

      $avatar = get_user_meta( $user_id,  'shr_pic', true);
      

      where,
      $user_id is the targeted user’s ID for which you want to fetach avatar.

      Let me know if you have further queries.

      Reply
  • November 7, 2014 at 11:00 am
    Permalink

    1- i make uploader.js.
    2- insert 3 last code box in the function theme.
    3-i went in edite user & upload my picture avatar & ok

    but not apply user avatar in my site!!!!!! 🙂

    Reply
    • November 7, 2014 at 4:45 pm
      Permalink

      Hello Bahman,

      Can you please tell me if you have written any custom code for displaying user avatar or not ?
      I must tell you that you have to written custom code for displaying user avatar.

      Waiting for your answer.

      Reply
  • November 7, 2014 at 6:53 pm
    Permalink

    no i have not any custom code for displaying user avatar.
    my template is sahife

    i insert all your code in my template function Except js>uploader.js
    my site
    tahaquran.ir

    Reply
    • November 8, 2014 at 3:47 pm
      Permalink

      Hi Bahman,

      Thumbnail is appearing large because I have used the size thumbnail.

      Please add following line to your functions.php file

      add_image_size('shr_custom_avatar',45,45,true);
      

      and following line in code give previously.

      $image	=	wp_get_attachment_image_src($custom_avatar, 'thumbnail');
      

      to

      $image	=	wp_get_attachment_image_src($custom_avatar, 'shr_custom_avatar');
      

      Let me know if its working.

      Reply
  • November 9, 2014 at 8:57 pm
    Permalink

    tank you very much

    of your Custom user avatar in wordpress code,

    Reply
  • January 30, 2015 at 10:30 pm
    Permalink

    First off, thanks for the awesome tutorial. This is really going to help out.

    Now I’ve inserted everything as the tutorial states. How do I call that image for a specific user? On my website I’ve included, I have a contributors page. I’m trying to call the image referenced in that user’s page in the image’s . But I misunderstood something obvious I think.

    Right now I have this:
    <img class="avatar" title="display_name; ?>’s avatar” src=””/>

    Reply
  • February 6, 2015 at 7:37 am
    Permalink

    avatar is not showing in comment form 🙁

    plz describe how to call custom avatar in comments avatar.

    Reply
    • February 6, 2015 at 12:50 pm
      Permalink

      What error you are getting ?

      Reply
  • April 23, 2015 at 2:19 am
    Permalink

    Thank your posts ,
    I have one problem, take out the upload form how homepage??

    Thanks!

    Reply
    • Ankit
      April 24, 2015 at 4:22 pm
      Permalink

      Please check javascript error in console and let me know about the same.

      Reply
  • May 18, 2015 at 10:34 am
    Permalink

    Only works with admin profiles.
    Author user not working
    help me, pls ???
    Thanks u!

    Reply
    • November 29, 2015 at 7:13 am
      Permalink

      change the function shr_add_admin_scripts with this code
      /*code star*/
      function shr_add_upload_scripts(){
      wp_enqueue_media();
      wp_register_script(‘shr-uploader’, get_template_directory_uri() . ‘/extensions/user-profile/avataruploader.js’, array(‘jquery’) );
      wp_enqueue_script(‘shr-uploader’);
      }
      add_action(‘init’, ‘shr_add_upload_scripts’);
      /*code end*/
      and you will have it work in frontend

      Reply
  • July 3, 2015 at 4:43 am
    Permalink

    Thanks you. but not support author user.

    Reply
    • Ankit
      July 3, 2015 at 1:09 pm
      Permalink

      Can you please elaborate your issue to allow me to understand better?

      Reply
  • July 17, 2015 at 8:11 am
    Permalink

    Help me please! how to call image in the sidebar , I want to make a widget about me.

    Reply
    • Ankit
      July 17, 2015 at 10:36 am
      Permalink

      What difficulty you are having when making widget?

      Reply
  • July 17, 2015 at 12:08 pm
    Permalink

    yes, I want to make a widget me with social media icons .

    I can do it without using any plugin?!

    Reply
  • September 3, 2015 at 8:58 am
    Permalink

    Thank you,
    I have a problem
    I wanted to share out the photo upload user interface is how (Front end upload avatar)

    Thank!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *