Badges

The badges add-on allows you to setup badges that your users can automatically earn based on their points history. For example if you reward users with points for approved comments, you could create a badge that is automatically awarded when a user has gained points e.g. 10 times for comments.

As of version 1.7, badges can have multiple requirements, combining different point types and / or different references. Furthermore you can reward your users with points for getting a badge or reaching a new badge level (if used).

Badge Sizes

While you can set the badge image sizes in the shortcodes that render them, you can also use CSS styling or the new PHP Constants to control the size of badges shown on your website. As of version 1.7, the badge images will be rendered in their full size. This means that if you uploaded a very large badge image, then the very large size of the image will show on your website. You can change the size of the images using CSS styling or you can use the badge size constants.

Example: Make sure all badge sizes are maximum 50px x 50px.

Badge Levels

As of version 1.6 you can add levels, eliminating the need to create multiple badges with different values. You can create as many levels as you need but you should consider with large websites with a lot of members that too many levels can come at a cost of performance.

To add a level to a badge visit the myCRED > Badges page and select to edit the badge in question. On the edit page simply click on the Add Level button and a new row is added for you. Add the amount requirement for this level and add an image. Repeat for each level.

Manual Badges

If you prefer, you can make manual badges, which will not be awarded to users automatically. These, along with non-manual badges can be assigned to a user by editing their profile in WordPress.

As of version 1.7, you will find all badges listed on the user edit screen where you can select which badge to award to the user and what level to use (if used).

When editing a users profile, you can also assign badges.

Showing Badges

In order for your users to see their badges, you need to use one the following shortcodes:

mycred_my_badges – This shortcode allows you to show a specific users or the current user who is viewing the shortcode’s 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’s requirements.

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.

Rewarding Badges

As of version 1.7, you can award or deduct points from your users for earning a particular badge level.

Installation

If you have BuddyPress or bbPress installed, the add-on can help you automatically insert users badges in their profiles.

The Badges add-on's settings.

Creating a New Badge

  1. Go to the myCRED > Badges page in your admin area.
  2. Click on the “Add New” button on the top of the page.
  3. Enter the title of this badge (required).
  4. If you want to show a badge image when a user has not yet earned this badge, then select and set an image for “Default Image”.
  5. Select the reference for which you want to give a badge and the amount of points a user has to have earned / lost to get this badge. You can select to either award a badge based on occurrence or total sum.
  6. Set the image you want to show when a user has earned the badge.
  7. If you are ready to use the badge click “Publish” while if you just want to save the badge for now, click “Save Draft”.
  8. Once you publish your badge, you must click on the “Assign Badge” button in the Publish metabox to get the badge working. You can also use this button to assign badge retroactively if your users has already started to earn points before you created your badge.
  9. Done!
The new badge editor as of version 1.7

Removing a Badge

The following steps are recommended when you want to delete a badge that has been earned by users.

  1. Edit the badge you want to remove in your admin area.
  2. In the “Publish” metabox, click on the “Remove Connections” button. This will make sure anyone who has earned the badge will no longer have this badge connected to them.
  3. Once completed, you can delete the badge.
Badge edit screen.

Last edited September 23, 2016