Skip to main content

Team Colors

The Team Colors module is included in SportsPress Pro. It adds a **Team Colors** meta box to the team edit screen and applies those colors to the frontend when a visitor views pages associated with the team.

Updated today

Team Colors

The Team Colors module is included in SportsPress Pro. It adds a Team Colors meta box to the team edit screen and applies those colors to the frontend when a visitor views pages associated with the team.

The Team Colors Meta Box

Open any team's edit screen. The Team Colors meta box appears in the main column below the content editor. It contains five color fields, each with a checkbox and a color picker:

  • Primary

  • Background

  • Text

  • Heading

  • Link

Each field has two parts:

  1. A checkbox labeled with the color name. When the checkbox is unchecked, the color is disabled and the site-wide theme color is used instead.

  2. A hex color input that opens a color picker when clicked. The picker uses the WordPress wp-color-picker (Iris) interface — you can pick a color visually or type a hex value directly.

The default value shown in the picker when a color is disabled is the current global theme color for that slot.

Enabling and Disabling Individual Colors

  • Check the checkbox next to a color name to activate that override for this team.

  • Uncheck the checkbox to revert to the global theme color for that slot.

  • You can enable any combination — for example, overriding only Primary and Background while leaving the other three at their global defaults.

Saving

Click Update on the team edit screen. Enabled colors are stored in the sp_colors post meta field as an associative array keyed by color name (primary, background, text, heading, link). Disabled colors are not stored.

Frontend Application

Team colors are applied as CSS variable overrides via the option_themeboy filter. The module injects the team's enabled colors into the frontend CSS whenever a visitor views:

  • A team page (sp_team singular)

  • An event page (sp_event singular) — colors from the first team listed on the event are used

  • A calendar page (sp_calendar singular) — colors from the first team assigned to the calendar

  • A player page (sp_player singular) — colors from the first team the player belongs to

  • A player list page (sp_list singular) — colors from the first team assigned to the list

  • A staff page (sp_staff singular) — colors from the first team assigned to the staff member

On event pages, if the Reverse Teams setting is enabled in SportsPress settings, the team order is reversed before selecting which team's colors to apply.

Teams List Column

When at least one color is enabled for a team, the Teams list screen displays colored blocks in the Logo column position alongside the logo. Each enabled color appears as a small colored rectangle, giving a quick visual overview of a team's assigned colors.

Did this answer your question?