mycred_my_badges

Description

This shortcode will show the user who is viewing it their earned badges. This shortcode will not show all badges no matter if a user has earned them or not. To show all badges, please use the mycred_badges shortcode instead.

Requires the Badges add-on to be enabled.

Available since version 1.5

Shortcode Attributes

Attribute Type Required Default Description
title INT No 0 Option to show the badge title (1) or hide it (0).
excerpt INT No 0 Option to show the badge excerpt (1) or hide it (0).
display STRING No vertical Option to set the alignment of the badges. For the horizontal alignment use (horizontal) and for the vertical (vertical).
show string No earned Option to set if you want to show the badges a user has earned (earned) or if you want to show all badges (all).
width int No MYCRED_BADGE_WIDTH The width of each badge image in pixels without the px. Do not use if you want to use the width set by the MYCRED_BADGE_WIDTH constant.
height int No MYCRED_BADGE_HEIGHT The height of each badge image in pixels without the px. Do not use if you want to use the height set by the MYCRED_BADGE_HEIGHT constant.
user_id string No current Option to show badges of a particular user. Accepts "current" for current user, "author" to show the post authors badges or a numeric user ID. Note that if you use "author", the shortcode must be used inside the loop!

CSS Styling

ul.mycred-users-badges { }

// Earned badges
ul.mycred-users-badges img { }

// All badges
ul.mycred-users-badges div.the-badge { }

Examples

Example 1: Default usage:

[mycred_my_badges]

Example 2: Show all badges, even those the user has not yet earned.

[mycred_my_badges show="all"]