Shortcodes

[wlt-league-table]

The following shortcode is only available in theĀ Pro version of the plugin.

A shortcode that displays a league table of Weight Loss Tracker users and their gain / lost and has the following arguments:

Argument Description Options Example
display By default the shortcode displays the words "Gained" and "Lost" in front of the weight value. The default also strips out the negative symbol when required. If you prefer to remove the text, but keep the negative symbol and only have the weight itself, set the display argument to "number" e.g. display="number". By default it will be set to "number". The value "number" or leave blank. [wlt-league-table display='number']
invert By default the shortcode displays total community weight lost in negative numbers. For example, say the community lost 140Kg between them, the shortcode would actually show -140Kg. If the community has gained 140Kg between them then it will display 140Kg. Some people prefer to inverse this logic - if you wish to, set the argument "invert" to true e.g. invert="true" True or false (default). [wlt-league-table invert='true']
force-to-kg If set to true, override global and user settings and display in Kg. True or false (default) [wlt-league-table force-to-kg='true']
number_to_show Maximum number of entries to show in table (default is 10). Number [wlt-league-table number_to_show=20]
losers_only If set to "true" only users that have lost weight will be in the table. True or false (default). [wlt-league-table losers_only=true]
show_percentage If set to "true" then the % lost / gained column is included in the table. True (default) or false. [wlt-league-table show_percentage=false]
ignore_cache By default the shortcode only looks in the database every 15 mins for the latest stats (reduces load on your database). If you wish to have instant stats, then set this argument to "true" (not recommended). True or false (default). [wlt-league-table ignore_cache=true]
order Sort the table by weight lost / gained. "asc" = most weight lost to least. "desc" least weight lost to most. "asc" or "desc" [wlt-league-table order='desc']

Below is a simple example of the shortcode:

Yes No Suggest edit
Help Guide Powered by Documentor
Suggest Edit