myCred User Ranks

Estimated reading: 2 minutes 539 views

myCred User Ranks

Description:
If the user_id is provided, the shortcode will render all the ranks that the user has earned. If user_id is not given, this shortcode will show earned ranks of the currently logged-in user.
Shortcode:
mycred_user_ranks

Shortcode Attributes:

Attribute

Type

Required

Default

Description

user_id

INT

Optional

current

By default, it will show you the “current” user-earned ranks which are looking at the page. You can see others’ user ranks by assigning the user id. If you set this attribute value to empty, nothing will appear.

type_id

INT

Optional

Specifying the “type_id” attribute will only show you the rank associated with the defined type_id.


Note: Many ranks can have the same type_id. Do not be confused if you see many ranks.

title

INT

Optional

1

Either set 0 to hide the title or 1 to show the title.

title_link

INT

Optional

1

Set the attribute value 0 to remove the anchor from the link.

image

INT

Optional

1

Set the attribute value 0 for hiding the rank image/logo.

image_size

INT

Optional

Set the value for resizing the image from the default dimension to the defined one. The value you’ll define will be considered, like the width and height of the image/logo.


e.g. image_size=230 or image_size=425 etc.

excerpt

INT

Optional

0

Set attribute value 1 to show the excerpt.

requirements

INT

Optional

0

Set the attribute value 1 to display the defined rank requirements on the front end.

earners

INT

Optional

0

Set the attribute value 1 to show the earned users who earned that rank.

earners_limit

INT

Optional

10

To change the limit of the number of earners.


e.g. earners_limit=9 or earners_limit=21

display

STRING

Optional

horizontal

To display the content in different styles, either use vertical or inline  values.


Note: If you’ve used inline, it will only show the rank image and title.

Note: Only other options will show except for requirements if your rank has been set to default.

Example 01: [mycred_user_ranks]

Example 02: [mycred_user_ranks title_link=0 display=”inline”]

Example 03: [mycred_user_ranks image=0 excerpt=1 earners=1 requirements=1]

Example 04: [mycred_user_ranks title=0 image=1 image_size=177 excerpt=1 earners=1 display=”vertical”]

Example 05: [mycred_user_ranks type_id=7 image=0 earners=1]

Example 06: [mycred_user_ranks type_id=7 user_id=19 requirements=1 excerpt=1 earners=1 display=”vertical”]