WordPress.org

Ready to get started?Download WordPress

Forums

Simple Local Avatars
Front End - Not showing up (4 posts)

  1. mattyprimmer
    Member
    Posted 2 years ago #

    The avatar upload is not showing up on the front end user edit screens. I used the code below to get it to show up:

    <?php
    $myAv = new simple_local_avatars();
    $myAv->edit_user_profile($profileuser);
    ?>

    It shows up, but doesn't show the current avatar (uploaded in back end) and when submitted it doesn't actually upload anything.

    Is there a way to get this working on the front end?

    http://wordpress.org/extend/plugins/simple-local-avatars/

  2. Abu Bakar
    Member
    Posted 1 year ago #

    I am facing same issue as well.

  3. voji91
    Member
    Posted 1 year ago #

    Florence said :

    Here's how I did it:

    Instal Simple Local Avatars

    Install this plugin http://wordpress.org/extend/plugins/php-code-for-posts/

    Add a new shortcode and enter this code:

    <?php get_header();
    global $user_ID;
    if ($user_ID) {
    $user_info = get_userdata($user_ID);
    $id = $user_info->ID;
    }
     ?>
    
    <?php if(isset($_POST['user_avatar_edit_submit']))
          {
               do_action('edit_user_profile_update', $id);
          }
    ?>
    
    <form id="your-profile" action="" method="post">
        <?php
        $myAv = new simple_local_avatars();
        $myAv->edit_user_profile($user_info);
        ?>
        <input type="submit" name="user_avatar_edit_submit" value="OK"/>
    </form>

    Copy and paste the shortcode onto a page and voilla! There's your front-end avatar uploader!

  4. jcow
    Member
    Posted 1 year ago #

    You need to make sure you include enctype="multipart/form-data" or the form will not upload an image on most servers, it will only send $_POST data, not $_FILES data.

    So the form open should be:

    <form id="your-profile" action="" method="post" enctype="multipart/form-data">

    Very useful, thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.