This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Avatar – User Photo Shortcode

Beskrywing

This plugin adds the avatar shortcode. It lets you show any user photo on your site. Simply place the [get_avatar] shortcode in you post content. While you can do this in templates many times you might want to show an avatar without writing PHP. This plugin adds the same paramaters that the get_avatar function does.

As a developer you might use this in your template:

<?php echo get_avatar( 'email@example.com', 64, 'http://www.example.com/custom-default-avatar.png', 'Image Alt Text' ); ?>

The above would get you this for logged in users:

<img alt="" src="https://secure.gravatar.com/avatar/123" class="avatar avatar-64 photo" height="64" width="64">

With this shortcode you can do the same thing in your content:
[get_avatar id=”email@example.com” size=”64″ default=”http://www.example.com/custom-default-avatar.png” alt”Image Alt Text”]

The shortcode would return almost the exact same thing with some additionals:

<span class="get_avatar " style=""><img alt="Image Alt Text" src="https://secure.gravatar.com/avatar/123" class="avatar avatar-64 photo" height="64" width="64"></span>

I added a span tag around the image to allow for additional styling. Just add the style or class attributes to the shortcode to customize it’s look.

[get_avatar class="circle"]

Currently I added the rounded and circle styles which you can use. Circle will make the image a complete circle similar to how gmail shows your picture in the top right corner.

[get_avatar style="border: 2px solid #000000"]

While you can include any of your classes using the class attribute you can also include styles inline using the method above. This will get added directly inline in the span tag. While this is good for general styling like borders, to add css directly to the image itself use either your own class or the get_avatar class and add any additional styling to your themes stylesheet.

This method gives you the most customization although it requires you to add css.

Using get_avatar in your stylesheet:

.get_avatar img {

}

Or you could add several different styles depending on the pages of your site.

For example I could add this to my stylesheet to style to style different avatars:

.get_avatar homepage img {

}

.get_avatar profilepage img {

}

.get_avatar author john_smith img {

}

Then my shortcodes would look like this :

[get_avatar class="homepage"]

[get_avatar class="profilepage"]

[get_avatar class="author john_smith"]

Thats pretty much it. See https://codex.wordpress.org/Function_Reference/get_avatar for the default template function usage. Questions or requests let me know.

Installation

This section describes how to install the plugin and get it working.

  1. Upload plugin-name.php to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Add the [get_avatar] shortcode in your content.

Kwel-vrae

How do I use the ID field?

Leave it blank to get the image of the currently logged in user :

[get_avatar]

Use some users email address :

[get_avatar id='johnsmith@gmail.com']

Use some users id :

[get_avatar id='2']

If you have other ways you’d like to be able to show specific users let me know and I will add a way to do it if it’s not already available.

Aanbevelings

September 3, 2016
I am not sure if this plugin has a compatibility issue with the current version of WordPress or if it is another problem, but it crashed my website upon download and I had to disable the plugin through the file manager in cPanel to uninstall and eventually get my site back up and running, which was a cumbersome process. I do NOT recommend downloading this plugin under any circumstances as it will cause you problems, and as a matter of fact I strongly feel it is highly irresponsible for the developer to have not made an attempt to either update or even test the plugin to check if it is compatible. Bryan, if you get around to reading this, I would strongly advise you to either take down this plugin or update it immediately and ensure it is tested so it does not cause any more problems for users, because it certainly did for me and I'm not happy about it.
Read all 2 reviews

Contributors & Developers

“Avatar – User Photo Shortcode” is oopbron sagteware. Die volgende mense het bygedra tot die ontwikkeling van hierdie uitbreiding:

Contributors