Displays a user’s avatar.
WordPress will tend to use avatars for your users from it’s www.gravatar.com service. You can always change that via the admin dashboard->Settings->Discussion.
However, in a social network, users will expect to be able to upload a picture to use as their own avatar. How they do that is through the use of the [wps-avatar-change] shortcode. This shortcode is used to display their avatar.
Provided in the Core Plugin.
You can use the global shortcode settings via WPS Pro->Shortcodes in the admin dashboard, or add them to the shortcode as options.
Here are two examples, the first setting as pixels, the second as a percentage (perhaps inside a DIV?)
[wps-avatar size="128"] [wps-avatar size="100%"]
A more advanced example, setting the size, and using before and after with HTML to “float” the avatar to the right of the screen:
[wps-avatar size="128" before="<div style='float:right'>" after="</div>"]
Which would show something like this:
Instead of using before and after, you can enter HTML straight into the text editor, this is a recommended approach if you are more familiar with coding.
Don’t forget to always use the “Text” view of the editor.
So, to repeat the above, using HTML directly, you would enter the following into the text editor:
<div style="float:right">[wps-avatar size="128"]</div>
As you will see later, when we create a custom profile page, the above technique tends to be used, as it is a more familiar way for those that already code.
With clever use, you can create an amazing profile page for your social network that will be completely unique!
The following (which shows default values and an example of using the shortcode option) can be set via the admin dashboard (WPS Pro->Shortcodes) or added as options to the shortcode in your WordPress page, post or widget.
|Size of the avatar||(size=”256″)|
|Show link to change avatar||(change_link=”0″)|
|Avatar links to profile page (if not current user’s avatar)||(profile_link=”0″)|