Codex / mycred/core / Shortcodes / mycred_leaderboard_position


This shortcode will show a users leaderboard position. It will only render the position and nothing more. Replaces the mycred_my_ranking shortcode, which was depreciated as of version 1.7. To show an actual leaderboard, consider using the mycred_leaderboard shortcode instead.

Available since version 1.7

Shortcode Attributes

Attribute Type Required Default Description
user_id int or string Yes - The user ID for whom we want to show a position for. Either the users numeric ID or the word "current" for the user that views the shortcode.
ctype string No - Option to show buyers that paid using a particular point type. Should not be used if you only have one point type installed or if users can only pay using one point type.
based_on string No balance Option to base the leaderboard on users balance (balance) or a particular reference. For example basing a leaderboard on who got most points for approved comments.
missing string No - String to show if the user is not in the leaderboard. This will occur when a user has not yet received points and hence can not be found to have a position.
suffix int No 0 Optinon to add an ordinal suffix ( e.g. 1st, 120th ). Use 1 to enable or 0 to disable.
timeframe string No - If the leaderboard is based on references, you can set a timeframe for the leaderboard. Accepts the keywords "today" for todays leaderboard, "this-week" for this weeks leaderboard, "this-month" for this months leaderboard or a well formatted date to start from.

CSS Styling

This shortcode does not render anything that can be directly styled using CSS.


Example 1: Default usage.

[mycred_leaderboard_position user_id="current"]


Example 2: Show my position based on approved comments.

[mycred_leaderboard_position user_id="current" based_on="approved_comments"]

Last edited November 25, 2016