Timelines
The Timelines module adds a play-by-play timeline to event pages. The timeline displays performance events (goals, cards, substitutions, and other timed stats) plotted along a visual representation of the match from kick-off to full time. It is part of SportsPress Pro.
Enabling the Timeline
The timeline section is registered as an event page template with the option key sportspress_event_show_timeline. Its default value is yes, so it is shown by default when the module is active.
To control whether the timeline appears on event pages, go to SportsPress → Settings → Events and look for the Timeline toggle in the event display section.
Layout Options
Go to SportsPress → Settings → Events → Timelines to configure the layout. The setting key is sportspress_timelines_format.
Horizontal (
horizontal) — The default layout. Events are plotted left-to-right along a horizontal bar from kick-off (KO) to full time (FT). Home team icons appear above the bar; away team icons appear below.Vertical (
vertical) — Events are listed in a vertical timeline format.
Data Source
The timeline is populated from the sp_timeline post meta key on the event. This meta is set when you enter minute values in the box score. For each performance stat that is "timed" (the sp_timed property on the performance variable), a set of minute input fields appears below the stat count in the Player Performance meta box. Enter the minute(s) at which each occurrence happened (e.g., 23 for a goal at minute 23).
Substitution times are also recorded in the timeline. When a player's Status is set to Substitute, a minute input appears in the Status column for the substitution time.
The [sportspress_timeline] Shortcode
The Timelines module registers the shortcode [sportspress_timeline] to embed a timeline for a specific event anywhere on the site.
Basic usage:
[sportspress_timeline id="123"]
Positional ID (shorthand):
[sportspress_timeline 123]
Parameters:
id— The post ID of the event. Required when used outside of an event page. When used on an event's own page andidis omitted,get_the_ID()is used automatically.format— The layout format. Acceptshorizontal(default) orvertical.
Examples:
[sportspress_timeline id="456" format="vertical"] [sportspress_timeline id="456" format="horizontal"]
Text Labels
The following text strings used in the timeline output can be customized via SportsPress → Settings → Text:
Timeline — Section heading label.
KO — Kick Off marker label.
FT — Full Time marker label.
