Player Gallery
The [player_gallery] shortcode displays players from a Player List as a photo gallery — a grid of player photos with names as captions.
What It Displays
A responsive grid of player thumbnail photos with player names below each image. Players can be grouped by position, each group with its own heading. Clicking a photo links to the player's page when link_posts is enabled.
When to Use It
Use on any page. Supply id pointing to a SportsPress Player List post. Inside the Loop on a Player List page, id can be omitted.
Parameters
Parameter | Type | Default | Description |
| integer |
| Post ID of the Player List. Required outside the Loop. |
| string/boolean |
| Override the displayed heading. |
| integer |
| Maximum number of players to display. |
| string/null | From list | Group players: |
| string |
| HTML heading tag for group headings when grouping is active. |
| string |
| Field to sort players by. |
| string |
| Sort direction: |
| integer |
| Number of columns in the photo grid. |
| string |
| WordPress image size to use for thumbnails. |
| string |
| HTML tag wrapping each gallery item. |
| string |
| HTML tag wrapping the image within each item. |
| string |
| HTML tag wrapping the caption within each item. |
| boolean |
|
|
| boolean | From settings |
|
Usage Examples
Minimal — photo gallery for a player list:
[player_gallery id="55"]
4-column gallery, grouped by position, with player links:
[player_gallery id="55" columns="4" grouping="position" link_posts="1"]
Random order gallery with a "View all players" link:
[player_gallery id="55" orderby="rand" show_all_players_link="1"]
