The add-on provides several tools to help you display badges on your website. You can use shortcodes or functions and if are using BuddyPress or bbPress, the add-on can help you automatically insert them into your users profiles.
The add-on has two build in shortcodes for displaying badges:
mycred_my_badges – This shortcode allows you to show a specific users or the current users badges.
mycred_badges – This shortcode allows you to show your users all the published badges existing on your website with an option to also include the badges’ requirement(s).
If you are using BuddyPress, the badges add-on can help you insert a users badges directly into their profiles without the need to use any shortcode. To do so, simply visit your myCRED Settings page and under “Badges” select where you want to show the badges.
You can show badges using the shortcodes in combination with the do_shortcode function as an example or you can use functions that the add-on provides. Here are a few functions that could be useful:
|mycred_get_users_badges||Returns an array of badge post IDs that a particular user has earned. Array keys represent the badge post ID while values represent levels.|
|mycred_display_users_badges||Renders a list of badge images a particular user has earned.|
|mycred_display_badge_requirements||Returns the requirements set for a particular badge.|