Skip to main content

League Table

The `[league_table]` shortcode displays a team standings table with configurable stat columns, sorting, and pagination.

Updated today

League Table

The [league_table] shortcode displays a team standings table with configurable stat columns, sorting, and pagination.

What It Displays

A data table with one row per team showing configured statistics columns (wins, draws, losses, points, goal difference, etc.). The first column shows team rank (position), the second shows team name with an optional logo. Highlighted position bands (promotion, relegation zones) follow the configuration of the League Table post.

When to Use It

Use on any page. Supply id pointing to a SportsPress League Table post. Inside the Loop on a single League Table page, id can be omitted.

Parameters

Parameter

Type

Default

Description

id

integer

get_the_ID()

Post ID of the League Table. Required outside the Loop.

number

integer

-1

Maximum number of teams to display. -1 shows all.

columns

string/array

null

Comma-separated column slugs to override the League Table's column selection (e.g. 'w,d,l,pts').

highlight

string

From post meta

Comma-separated position ranges to highlight (e.g. zones). Defaults to the sp_highlight meta on the table post.

show_full_table_link

boolean

false

1 to show a "View full table" link below the table (requires id).

title

string/boolean

false

Override the displayed heading.

show_title

boolean

From settings

1 to display the table title. Default from Tables > Show title setting.

show_team_logo

boolean

From settings

1 to display team logos. Default from Tables > Show logos setting (yes).

link_posts

boolean

From settings

1 to link team names to their pages. Defaults to the Link teams or Link players global setting based on table mode.

sortable

boolean

From settings

1 to enable client-side column sorting.

responsive

boolean

From settings

1 to enable responsive table mode.

scrollable

boolean

From settings

1 to enable horizontal scrolling.

paginated

boolean

From settings

1 to paginate the table.

rows

integer

From settings

Rows per page when pagination is active. Default from Tables > Rows setting (10).

show_published_events

boolean

When set, overrides whether published (past) events are included in calculations.

show_future_events

boolean

When set, overrides whether future events are included in calculations.

Usage Examples

Minimal — full league table:

[league_table id="42"]

Top 5 teams with custom columns, logos, and a "View full table" link:

[league_table id="42" number="5" columns="w,d,l,pts" show_team_logo="1" link_posts="1" show_full_table_link="1"]

Compact table without pagination:

[league_table id="42" paginated="0" sortable="0"]

Did this answer your question?