🎯 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 →

Custom Player Statistics Shortcode

Pro Feature

The Custom Player Statistics shortcode creates fully customizable player statistics tables with complete control over columns, sorting, filtering, and display options. Build custom leaderboards with interactive tables featuring sorting, pagination, and frozen columns.

Shortcode

[sl-stats-players-custom]

Screenshot

When to Use

  • Custom leaderboards (top scorers, assists, cards)
  • Season statistics tables with multiple stat columns
  • Position-specific stats (goalkeepers, forwards)
  • Per-game averages tables
  • Multi-stat comparison tables

Shortcode Builder

The easiest way to create this shortcode is through the Shortcode Builder. Navigate to Sports Leagues > Shortcodes, select “Stats Players Custom” from the dropdown, and configure your options visually.

Parameters

Column Selection

ParameterDefaultDescription
columns(required)Comma-separated stat column IDs to display
sort_columnColumn to sort by initially
sort_orderDESCSort order: DESC (descending) or ASC (ascending)

Available Column IDs:

  • ranking – Ranking place
  • player_name – Player name
  • team – Team
  • position – Position
  • played_games – Games played
  • Plus any configured player statistic IDs from your Sport Configuration

Query Filters

ParameterDefaultDescription
season_idFilter by season ID
league_idFilter by league ID
team_idFilter by team ID
tournament_idFilter by tournament ID
stage_idFilter by tournament stage ID
group_idFilter by standing group ID
round_idFilter by round ID
venue_idFilter by venue ID
positionFilter by player position(s), comma-separated

Tabulator Options

This shortcode uses Tabulator.js by default for interactive tables with sorting, pagination, and frozen columns.

ParameterDefaultDescription
tabulator1Use Tabulator.js: 1 (yes) or 0 (no)
rows10Rows per page
paging1Enable pagination: 1 (yes) or 0 (no)
frozen_columnsranking,player_nameComma-separated columns to freeze on horizontal scroll
column_font_size10Column font size in pixels
max_column_width50Maximum stat column width in pixels
max_col_team_width120Maximum team column width in pixels
max_col_pos_width60Maximum position column width in pixels
layout_modevenLayout mode: even, fitData, or fitDataFill

Display Options

ParameterDefaultDescription
limit10Maximum rows to display
headerCustom table header text
team_columnabbrTeam display format: abbr (abbreviation), title (full name), or code
full_column_namefullColumn header format: full or short
per_game0Show per-game averages: 1 (yes) or 0 (no)
per_game_digits0Decimal places for averages
short_position1Use short position names: 1 (yes) or 0 (no)
hide_zeros1Hide zero values: 1 (yes) or 0 (no)
hide_empty_columns1Hide columns with no data: 1 (yes) or 0 (no)
classAdditional CSS classes for the wrapper

Legacy DataTables Options

For backwards compatibility, DataTables can be used instead of Tabulator.

ParameterDefaultDescription
data_table0Use DataTables instead of Tabulator: 1 (yes) or 0 (no)
data_table_page_length10DataTables page length
data_table_searching1Enable search: 1 (yes) or 0 (no)
data_table_page_menu1Show page menu: 1 (yes) or 0 (no)
data_table_info0Show info: 1 (yes) or 0 (no)

Examples

Top 10 Scorers

Display the top 10 goal scorers for a season:

[sl-stats-players-custom columns="ranking,player_name,team,goals" season_id="2024" limit="10" sort_column="goals" header="Top Scorers 2024"]

Goalkeeper Statistics

Show goalkeeper-specific stats filtered by position:

[sl-stats-players-custom columns="ranking,player_name,team,played_games,clean_sheets,goals_conceded,saves" position="goalkeeper" season_id="2024"]

Per-Game Averages

Display per-game averages with decimal precision:

[sl-stats-players-custom columns="ranking,player_name,team,goals,assists,shots" per_game="1" per_game_digits="2" tournament_id="15"]

Team-Specific Leaders

Show stat leaders for a specific team:

[sl-stats-players-custom columns="ranking,player_name,position,goals,assists,yellow_cards,red_cards" team_id="42" season_id="2024" sort_column="goals"]

Multi-Stat Table with Custom Layout

Create a comprehensive stats table with custom column widths:

[sl-stats-players-custom columns="ranking,player_name,team,position,goals,assists,shots,shots_on_target" season_id="2024" limit="20" frozen_columns="ranking,player_name" column_font_size="11" hide_zeros="1" layout_mod="fitDataFill"]

Finding Stat Column IDs

The columns parameter requires stat IDs from your Sport Configuration. To find available stat IDs:

  1. Go to Sports Leagues > Settings > Sport Configuration
  2. Look at the Season Player Statistics section
  3. Use the stat ID values (e.g., goals, assists, yellow_cards)

Tip

Use the Shortcode Builder to select columns from a visual interface – it will automatically generate the correct column IDs for you.

Frozen Columns

When displaying tables with many columns, frozen columns stay visible while scrolling horizontally. By default, the ranking and player name columns are frozen. You can customize which columns freeze using the frozen_columns parameter.

Related