WordPress.org

Ready to get started?Download WordPress

Forums

User Avatar
Avatar Shortcode for Page (9 posts)

  1. mimismiles
    Member
    Posted 2 years ago #

    I'm trying to insert a shortcode that will show a different author avatar in a page.

    How do I do it?

    http://wordpress.org/extend/plugins/user-avatar/

  2. enej
    Member
    Plugin Contributor

    Posted 1 year ago #

    Sorry there are no shortcodes available for the plugin.

    Maybe in the next release.

  3. Florence
    Member
    Posted 1 year ago #

    Hi Enejb, that would be absolutely perfect. It would mean I could finally integrate user avatar with the custom profile page of s2members (which also works with a shortcode). Are you working on a new release? When do you think it'll be ready? If it's only a couple of weeks or months, I can afford to wait.

  4. Florence
    Member
    Posted 1 year ago #

    Never mind, I found another way.

  5. makmacmc
    Member
    Posted 1 year ago #

    Hello.

    @floortjahh - would you mind sharing what you did as I need to do the same?

    Thanks!

  6. Florence
    Member
    Posted 1 year ago #

    Sure! I have a profile using a shortcode so I was looking for a box using a shortcode as well. 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!

    I'm not using this anymore though. It's not very elegant. I'm now using buddypress for its profiles, which intergrates nicely with S2 members.

    Anyway, good luck!

  7. makmacmc
    Member
    Posted 1 year ago #

    Great Thanks I got it working. Your help was much appreciated! Now I just need to figure out some styling for it.

    Thanks!

  8. Florence
    Member
    Posted 1 year ago #

    You're welcome. Good luck!

  9. artheme
    Member
    Posted 1 year ago #

    It does not work with my site. The upload form is shown on the front end, but the avatar does not changed.

    Do you have any advice to resolve this problem?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags