🎯 Need Help?

Get Premium Support

Priority assistance from the developer

More from ANWP

Football Leagues Premium

Complete football/soccer league management for WordPress

Learn more →

Team Statistics Shortcode

Pro Feature

Shortcode: [sl-teams-stats]

Display ranked team statistics with flexible filtering and calculation options.

Overview

The Teams Stats shortcode creates a ranked table of teams based on any configured statistic. You can display totals, averages per game, or find minimum/maximum values. Filter by tournament, league, season, or date range, and optionally show only home or away performance.

Use Cases

  • Show team offensive rankings (points scored, yards gained)
  • Display defensive statistics (points allowed, tackles)
  • Compare home vs away performance for teams
  • Create “Top 5” sidebar widgets with team leaders
  • Track season-long or tournament-specific team stats

Using the Shortcode Builder

The easiest way to create the shortcode is through the visual Shortcode Builder:

  1. Go to Sports Leagues > Shortcodes
  2. Select Teams Stats from the dropdown
  3. Choose the statistic you want to display
  4. Set your filters (tournament, season, etc.)
  5. Configure display options
  6. Copy the generated shortcode

Parameters

Stats Selection

ParameterTypeDefaultDescription
stats_idString(required)The team statistic to display (configured in Sport Configurator)
calculationStringsumHow to calculate: sum, min, max, or avg_game
digitsInteger0Decimal places for calculated values (useful with avg_game)

Query Filters

ParameterTypeDefaultDescription
tournament_idInteger–Filter by tournament ID
stage_idInteger–Filter by tournament stage ID
season_idInteger–Filter by season ID
league_idInteger–Filter by league ID
group_idInteger–Filter by standing group ID
round_idInteger–Filter by round ID
venue_idInteger–Filter by venue ID
game_dayInteger–Filter by specific game day number
home_awayString–Filter by game location: home or away (empty = all)
date_fromString–Start date filter (YYYY-MM-DD format)
date_toString–End date filter (YYYY-MM-DD format)
days_offsetInteger–Dynamic date offset from today (negative = past)
days_offset_toInteger–Dynamic end date offset from today

Display Options

ParameterTypeDefaultDescription
orderString–Sort order: empty (descending) or ASC (ascending)
team_nameString–Team name format: empty (full name), abbr (short name), code
limitInteger0Maximum teams to display (0 = all)
show_logoInteger1Show team logo: 1 (yes) or 0 (no)
show_games_playedInteger0Show games played column: 1 (yes) or 0 (no)
link_to_teamInteger0Make team name clickable: 1 (yes) or 0 (no)
show_fullInteger0Show “View All” link for modal: 1 (yes) or 0 (no)
hide_headerInteger1Hide table header row: 1 (yes) or 0 (no)
custom_headerString–Custom header text above the table
custom_header_tagString–HTML tag for custom header (e.g., h3, h4)
max_widthString–Maximum table width (CSS value)
min_widthString–Minimum table width (CSS value)
classString–Additional CSS classes for the wrapper

Examples

Basic Tournament Stats

Display total yards for all teams in a tournament:

[sl-teams-stats stats_id="Total Yards" tournament_id="5665"]

Average Per Game

Show points per game with one decimal place:

[sl-teams-stats stats_id="Points" tournament_id="5665" calculation="avg_game" digits="1" show_games_played="1"]

Top 5 Teams

Display top 5 with links and a “View All” option:

[sl-teams-stats stats_id="Total Yards" tournament_id="5665" limit="5" link_to_team="1" show_full="1"]

Home Performance Only

Show stats from home games only:

[sl-teams-stats stats_id="Points" tournament_id="5665" home_away="home"]

Season Stats with Short Names

Display league stats using abbreviated team names:

[sl-teams-stats stats_id="Points" league_id="12" season_id="45" team_name="abbr"]

Lowest Values (Ascending Order)

Show teams with fewest points allowed (best defense):

[sl-teams-stats stats_id="Points Allowed" tournament_id="5665" order="ASC" limit="10"]