🎯 Need Help?

Get Premium Support

Priority assistance from the developer

⬆️ Upgrade

Unlock all features

More from ANWP

Sports Leagues Premium

Multi-sport league management with advanced statistics

Learn more →

AnWP SL Theme Kit

Starter themes & block patterns for Sports Leagues

Learn more →

Cards Shortcode


Display discipline rankings showing players or clubs with the most yellow and red cards. Cards are converted to points for fair comparison (default: red card = 5 points, yellow-red = 2 points, yellow = 1 point).

Basic Usage

[anwpfl-cards competition_id="12" type="players" limit="10"]

This displays the top 10 players with the most disciplinary points in competition 12.

All Parameters

Query Parameters

Parameter Default Description
type players Ranking type: players or clubs
competition_id (empty) Competition ID to get stats from
season_id (empty) Filter by Season ID
league_id (empty) Filter by League ID
club_id (empty) Filter by Club ID(s) – comma-separated
limit 0 Maximum entries to show. Use 0 for unlimited
soft_limit yes Include ties at limit boundary. Use no for exact cutoff
join_secondary 1 Include secondary stages (multistage competitions). Use 0 to disable

Note

By default, join_secondary="1" includes all stages of multistage competitions. The Competition Selector only shows main stages. To get statistics for a specific stage (knockout or playoff), enter the stage ID manually in competition_id and set join_secondary="0".

Display Parameters

Parameter Default Description
layout default Display layout: default or mini
show_photo yes Show player photos/club logos. Use no to hide
hide_zero 0 Hide entries with zero points. Use 1 to enable
sort_by_point (desc) Sort direction: empty for descending, asc for ascending

Point Values

Parameter Default Description
points_r 5 Points for a straight red card
points_yr 2 Points for a yellow-red (second yellow) card

Note

Yellow cards are always worth 1 point. The total is calculated as: (Yellow × 1) + (Yellow-Red × points_yr) + (Red × points_r)

Layout Comparison

The same eight players, rendered by each layout:

Default

Cards shortcode, default layout - players ranked by disciplinary points with photo, club, and separate yellow, second-yellow and red card columns

mini

Cards shortcode, mini layout - the same card ranking condensed to a narrow list for a sidebar

Examples

Example 1: Top 10 Dirtiest Players

When to use: Competition discipline page.

[anwpfl-cards competition_id="12" type="players" limit="10"]

Result: Top 10 players by disciplinary points.

Example 2: Club Discipline Rankings

When to use: Show which teams have the worst discipline.

[anwpfl-cards competition_id="12" type="clubs"]

Result: All clubs ranked by total disciplinary points.

Example 3: Single Club’s Discipline

When to use: Club page showing their players’ cards.

[anwpfl-cards competition_id="12" type="players" club_id="8"]

Result: Only players from club 8, ranked by cards.

Example 4: Custom Point Values

When to use: When your league uses different disciplinary point values.

[anwpfl-cards competition_id="12" type="players" points_r="10" points_yr="3"]

Result: Rankings using red = 10 points, yellow-red = 3 points.

Example 5: Sidebar Mini Layout

When to use: Compact widget showing top offenders.

[anwpfl-cards competition_id="12" type="players" limit="5" layout="mini"]

Result: Compact list of top 5 most-carded players.

Troubleshooting

No entries showing?

  • Verify cards are recorded in match events (not just team stats)
  • Check competition_id is correct
  • If using hide_zero="1", only players with cards will show

Points seem wrong?

  • Check your points_r and points_yr values
  • Yellow cards are always worth 1 point

Related