As of version 0.4 the plugin comes with a shortcode which can be used to show lists of avatars on a page or inside a post. It’s simple: just add [authoravatars]
into your post and hit save!
Available Parameters
Just as for the widget you can use various parameters to configure the list of users.
roles
: Only show users of a certain role
Restrict the list of users by roles to show only users belonging to certain roles. Possible values in a default WordPress setup are: administrator, editor, author, contributor, subscriber
. Separate multiple values by a comma.
Example: [authoravatars roles=administrator,editor]
hiddenusers
: Remove users from the list
Hide one or multiple users from the list. Both login names and user ids are allowed as values. Separate multiple values by a comma.
Example: [authoravatars hiddenusers=admin]
avatar_size
: The size of the avatar images
You can adjust the size of the avatar by specifying the avatar_size parameter.
Example: [authoravatars avatar_size=25]
: Disable the link to author pages (deprecated)
This is deprecated since version 0.7. Please use the user_link
parameter instead.
By default user avatars are linked to their Author Page. If your theme doesn’t support them or you don’t want to show them e.g. for subscribers, then you can easily disable them by setting this parameter to false.
Example: [authoravatars link_to_authorpage=false]
user_link
: Link user avatars to user website, blog or authorpage
As of version 0.7 you can link users not only to their respective Author Page but also their website if available or blog on WordPress MU sites.
Version 0.7.3 adds the option to link users to their respective BuddyPress Members page.
Allowed values:
false
authorpage
(default)website
last_post
- last_post_all (wpmu only)
blog
(wpmu only)bp_memberpage
(only if BuddyPress installed)bppress_memberpage
(only if bbpress installed)um_profile
(only if Ultimate Member is install)- any field in the get_the_author_meta that returns a URL ( contact info ) ( version 1.9.7 + )
Example: [authoravatars user_link=website]
As of version 1.9.7 you can pass a comma-separated list to this as fall through if a URL is not found in first selection
Example: [authoravatars user_link=website,last_post]
show_name
: Show user names next to avatars
If you’d like to show the user display names next to the avatars set the show_name
parameter to true.
Example: [authoravatars show_name=true]
show_biography
: Show user biographies next to avatars
If you’d like to show the user biographies next to the avatars set the show_biography
parameter to true.
Example: [authoravatars show_biography=true]
show_postcount
: Show the users’ post count next to their name
Set this option to true to show a user’s postcount next to their name (in brackets). If the user name is not displayed (see “show_name” parameter) then the postcount will be shown within the title of the image, i.e. it can be seen on mouse-over.
Example: [authoravatars show_postcount=true]
min_post_count
: Set a required minimum number of posts
Since version 0.8 you can only show users which have a specified number of posts. This allows for example to hide all authors which have not written any posts yet.
Example: [authoravatars min_post_count=1]
limit
: The maximum number of avatars shown
Example: [authoravatars limit=3]
order
: The order in which users are shown
Users are ordered by their display name A-Z by default. You can adjust this by changing this parameter. Possible values are:
- random,
- user_id,
- user_login,
- display_name,
- last_name,
- first_name,
- post_count (0.7+),
- bbpress_post_count,
- date_registered (0.7+),
- recent_site_activity,
- recent_post_activity,
- budy_press_recent_activity
Example: [authoravatars order=random]
page_size
: Max number per page
With this set paging markup (“< 1 2 3 4 5 >”) will be displayed below the avatars block.
The avatars are reloaded via ajax.
Note: this code is only used in the shortcode in page or post and not in a widget.
Example: [authoravatars page_size=10]
sort_direction
: The direction in which users are ordered
As of version 0.7 you can specify the sort direction, ascending or descending.
Valid values are “asc” or “ascending” (default) and “desc” or “descending”.
Example: [authoravatars order=date_registered sort_direction=descending]
You can also use this shorter version:
Example: [authoravatars order=date_registered,desc]
blogs
which blogs to show authors from
This is only for multi-site (WPMU) mode.
Before you use this you need to grant a site permission to see other blogs in the site on the network admin control panel
/wp-admin/network/settings.php?page=wpmu_author_avatars
Without this parameter we only look at the current blog to List authors from all blogs add “blogs-all”
Example: [authoravatars blogs=all]
or just some blogs
Example: [authoravatars blogs=1,2,5]
Note: Use with care as on big sites this will tax the server as SQL gets very big and number of images being fetch grows
render_as_list
: Change the rendering template to a list. (deprecated)
This is deprecated since version 0.7.3. This option is probably going to be removed once a more advanced template system is in place. You can get the same effect by using userlist template filters as described in the Developers Guide.
Set this parameter to true, if you would like the list of users to be rendered using a html list (
-
- ) instead of a bunch of
Example:
[authoravatars render_as_list=true]
6 responses to “Shortcode: [authoravatars]”
[…] lists can be inserted into your sidebar by adding a widget or into posts/pages by using a shortcode. The plugin comes with a tinymce editor plugin which makes inserting shortcodes very […]
[…] lists can be inserted into your sidebar by adding a widget or into posts/pages by using a shortcode. The plugin comes with a tinymce editor plugin which makes inserting shortcodes very […]
[…] plugin uses a simple [authoravatars] shortcode that you can either paste as it is or update with custom values in […]
[…] by adding a widget or into posts/pages, the plugin will let you do so by seamlessly adding a shortcode with its TinyMCE editor […]
[…] by adding a widget or into posts/pages, the plugin will let you do so by seamlessly adding a shortcode with its TinyMCE editor […]
[…] El plugin Author Avatars List / Block también le permite agregar listas de autores a su sitio web usando el shortcode. Esto es útil si está utilizando el editor clásico de WordPress. Para obtener más detalles, consulte la documentación del complemento. […]