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

Roster Shortcode


Overview

The Roster shortcode displays a team’s players for a specific season. Use it to show squad lists on team pages, create printable team sheets, or display roster information anywhere on your site.

Key Features:

  • Display players assigned to a team for a specific season
  • List or grid layout options
  • Optional custom title
  • Links to individual player profiles

Quick Reference

[sl-roster team_id="45" season_id="5"]

Important

Both team_id AND season_id must be specified for the shortcode to work.

Parameters

ParameterDefaultDescription
team_id(required)Team post ID
season_id(required)Season term ID
title(empty)Custom title displayed above the roster
layout(empty)Display layout: empty for list view, or grid for card layout
headerfalseShow the default “Roster” header when set to true

Examples

Basic Usage

[sl-roster team_id="45" season_id="5"]

Displays team #45 roster for season #5 in the default list format.

With Custom Title

[sl-roster team_id="45" season_id="5" title="First Team Squad 2024/25"]

Roster with a custom title displayed above the player list.

Grid Layout

[sl-roster team_id="45" season_id="5" layout="grid"]

Players displayed in a card-based grid format with photos.

Complete Example

[sl-roster team_id="45" season_id="5" title="Lakers Squad" layout="grid" header="true"]

Grid layout roster with both a custom title and the default header.

Layout Options

LayoutValueBest For
List(empty)Detailed player info, printable sheets, narrow areas
GridgridVisual presentations, photo galleries, wide areas

Finding IDs

Team ID

  1. Go to Sports Leagues → Teams
  2. Click Edit on the team you want
  3. Look at the URL in your browser: post.php?post=45
  4. The number after post= is your Team ID (45 in this example)

Season ID

  1. Go to Tournaments → Seasons
  2. Click on the season name
  3. Look at the URL: tag_ID=5
  4. The number after tag_ID= is your Season ID (5 in this example)

Tip

Use the Shortcode Builder to select teams and seasons visually without needing to find IDs manually. Look for it in the page editor toolbar.

Prerequisites

Before the roster shortcode displays anything, make sure you have:

  1. Created players – Go to Sports Leagues → Players
  2. Assigned players to the team – Go to Teams → Edit Team → Team Roster tab
  3. Selected the correct season when assigning players to the roster

Troubleshooting

Roster is Empty

Problem: The shortcode displays but shows no players.

Solution:

  1. Go to Teams → Edit Team → Team Roster tab
  2. Select the correct season from the dropdown
  3. Add players to the roster
  4. Save the team

Nothing Displays

Problem: The shortcode area is completely blank.

Solution:

  • Check that both team_id AND season_id are provided
  • Verify the IDs are correct by checking URLs in the admin
  • Ensure the team post is published (not draft)
  • Confirm the season term exists

Shortcode Shows as Text

Problem: [sl-roster ...] appears as plain text instead of rendering.

Solution:

  • In Gutenberg: Use a Shortcode block, not a Paragraph block
  • In Classic Editor: Switch to Text mode (not Visual)
  • Check for typos in the shortcode name (sl-roster not sl_roster)

Template Customization

You can customize the roster appearance by copying the template file to your theme:

  1. Copy plugins/anwp-sports-leagues/sports-leagues/templates/shortcode-roster.php
  2. Paste to your-theme/sports-leagues/shortcode-roster.php
  3. Edit the template file in your theme

Note

For grid layout, use shortcode-roster--grid.php instead.