Additional menu

Get MemberPress today! Start getting paid for the content you create! Get MemberPress Now
  1. Home
  2. Knowledge Base
  3. Advanced Topics
  4. Miscellaneous
  5. How to Add User Profile Image tab to the Account page?

How to Add User Profile Image tab to the Account page?

If you're looking to have a user profile image tab on the Account page where users can easily add their profile image and use it through your website, look no further than the
One User Avatar plugin.

To add a user profile image tab, please follow the steps below:

  1. Navigate to your WordPress Dashboard > Plugins > Add New, and search for “One User Avatar”. It is the one developed by One Designs.
  2. Install and activate this plugin.
  3. Activate Allow Contributors & Subscribers to upload avatars option to allow users to upload their own avatars.

  1. Optionally change the default avatar size in Avatars > Settings page:

  2. Create a special Profile Image tab on the Account page. There are two ways to do this that are listed below.
  3. Activate Allow Contributors & Subscribers to upload avatars option to allow users to upload their own avatars.

Use Custom Functions

If you are familiar with PHP, you can add the code below at the bottom of your active theme's function or use the WPCode pluginĀ (please check this article for details: How to add custom code snippets in WPCode).

<?php
function mepr_add_image_tab($user) {
    ?>
    <span class="mepr-nav-item custom-image">
      <a href="/index.php/account/?action=profile-image">Profile Image</a>
    </span>
    <?php
}
add_action('mepr_account_nav', 'mepr_add_image_tab');

function mepr_add_image_tab_content($action) {
    if($action == 'profile-image') {
        echo do_shortcode('[avatar_upload]');
    }
}
add_action('mepr_account_nav_content', 'mepr_add_image_tab_content');
?>

Displaying profile image

Adding a user profile image like this will change the user picture called avatar in all places where the user picture is displayed. It will also replace the user image from the Gravatar site assigned to the user's email. The most popular place where the user picture is displayed is the post comments, but you can display it anywhere using the following shortcode:

[avatar user="current"]
Was this article helpful?

Related Articles

computer girl

Get MemberPress today!

Start getting paid for the content you create.