mycred_my_rank

Codex / mycred/rank / Shortcodes / mycred_my_rank

Description

This shortcode allows you to show the rank title or logo of the user viewing the shortcode. Will not show anything if viewed by someone who is not logged in.

Requires the Ranks add-on to be enabled.

Available since version 1.3

Shortcode Attributes

Attribute Type Required Default Description
user_id string No current Option to show the rank of a particular user. Accepts "current" for current user or a user ID.
ctype string No MYCRED_DEFAULT_TYPE_KEY The point type to show. Should not be used if you only have one point type installed.
show_title int No 1 Option to show the rank title (1) or not (0).
show_logo int No 1 Option to show the rank logo (1) or not (0).
logo_size string No post-thumbnail The logo size (if set to be shown). accepts "post-thumbnail" for thumbnail size, "full" for full size.
first string No logo Option to show title first (title) or the logo (logo) first.

CSS Styling

div.mycred-my-rank { }

// If logo is used
div.mycred-my-rank img { }

Examples

Example 1: Show current users rank logo only.

[mycred_my_rank show_title=0 show_logo=1]

Example 2: Show a given users rank and the rank logo but with the rank first.

[mycred_my_rank user_id=123 show_title=1 show_logo=1 first="name"]

Example 3: Show the current users rank for the custom point type ``mycustomtype``.

[mycred_my_rank user_id="current" ctype="mycustomtype"]

Last edited August 30, 2016