Skip to main content

Gallery Layout

The Gallery format displays players as a photo grid rather than a data table.

Updated today

Gallery Layout

The Gallery format displays players as a photo grid rather than a data table.

Setting the Format

On the player list edit screen, open the Format sidebar meta box and select Gallery.

Rendering

The gallery is output using the [player_gallery] shortcode internally. Each player appears as an image tile with their squad number and name as a caption.

The HTML structure uses:

  • <dl> as the item container (configurable via itemtag)

  • <dt> for the thumbnail (configurable via icontag)

  • <dd> for the caption (configurable via captiontag)

Columns per Row

The default number of columns (thumbnails per row) is 3. Change this with the columns parameter in the [player_gallery] shortcode:

[player_gallery id="99" columns="4"]

Image Size

The default image size is thumbnail. Change it with the size parameter:

[player_gallery id="99" size="sportspress-fit-icon"]

SportsPress registers several named image sizes. Common options include thumbnail, sportspress-fit-icon, and sportspress-fit-mini.

When No Photo Is Uploaded

If a player has no featured image (photo), the gallery tile is still rendered but the thumbnail area is empty. No placeholder image is substituted. The player's name and number still appear in the caption.

Grouping by Position

Set Grouping to Position in the Details meta box (or use grouping="position" in the shortcode) to insert position headings between player groups. The heading tag defaults to <h4> and is configurable with grouptag.

Linking Player Photos

By default, thumbnails link to the player's profile page. Disable this with link_posts="0" in the shortcode.

Add a "View all players" link below the gallery with show_all_players_link="1" in the shortcode.

Shortcode Reference

[player_gallery id="99" columns="4" size="sportspress-fit-icon" grouping="position" grouptag="h3" show_all_players_link="1"]

See the Player Gallery Shortcode article for the full parameter list.

Did this answer your question?