Sports API Hub includes 13 shortcodes for embedding sports data anywhere on your site. Use the built-in Shortcode Builder to configure options and preview output — no coding required.
🎯 Shortcode Builder
Go to Settings & Tools > Shortcodes to open the builder.
- Select a shortcode from the dropdown
- Fill in the fields — sport, season, team, display options
- The generated shortcode updates in real time at the top
- Check the Preview panel to see how it looks
- Copy the shortcode and paste it into any post or page
The preview renders your shortcode exactly as visitors will see it. Use the width toggles (400px / 700px / Full) to check how it looks at different screen sizes.
Tip
Fields marked with * are required. Some fields depend on others — for example, choosing a sport resets the season and team selectors to match that sport.
Game Shortcodes
[anwphub-games] — Game List
Displays games as cards in a responsive grid. Filter by sport, season, league, team, status, or date range.
| Attribute | Default | Description |
|---|---|---|
sport_id | all | Filter by sport (1=Basketball, 2=Baseball, etc.) |
season_id | — | Season ID(s). Supports multiple (comma-separated) |
league_id | — | League ID(s). Supports multiple |
team_id | — | Team ID(s). Supports multiple |
status | all | finished or fixture |
date_from | — | Start date (YYYY-MM-DD) |
date_to | — | End date (YYYY-MM-DD) |
days_offset | — | Days back from today (e.g. -3). Overrides date_from |
days_offset_to | — | Days forward from today (e.g. 3). Overrides date_to |
sort | asc | asc (oldest first) or desc (newest first) |
limit | 10 | Number of games to show |
group_by | — | Group games by day or league |
layout | list | list or grid |
team_display | global | Team display mode: auto, auto-outlined, logo, logo_code, badge-filled, badge-outlined |
show_load_more | no | Show “Load More” button for pagination |
Examples:
[anwphub-games sport_id="1" status="finished" limit="5" sort="desc"]
[anwphub-games team_id="3419" status="fixture" sort="asc" limit="10"]
[anwphub-games sport_id="1" date_from="2026-01-01" date_to="2026-01-31" group_by="day"]
[anwphub-game] — Single Game
Embeds specific game sections into any page — like a mini game page. Choose which sections to show (header, box scores, timeline, etc.).
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
game_id | — | Specific game to display |
team_last | — | Show team’s last finished game (fallback if no game_id) |
team_next | — | Show team’s next upcoming game (fallback if no game_id) |
sections | — | Comma-separated section keys (see below) |
section_header | yes | Show section headers |
3 resolution modes: Use game_id for a specific game, team_last for a team’s most recent result, or team_next for a team’s next fixture.
Available sections (21): header, box_scores, batting, pitching, team_stats, four_factors, leaders, timeline, flow, timeline_flow, odds, highlights, venue, info, stats_comparison, key_players, recent_form, matchup_history, form_comparison, rankings_comparison, standings_context
[anwphub-game sport_id="1" team_last="3419" sections="header,leaders,box_scores"]
[anwphub-game sport_id="1" game_id="12345" sections="header,timeline,flow"]
[anwphub-calendar] — Game Calendar
Interactive day-by-day game browser with status filter pills (Live / Finished / Upcoming) and date navigation arrows. Games are grouped by league in a responsive card grid.
| Attribute | Default | Description |
|---|---|---|
sport_id | all | Filter by sport. Omit for multi-sport calendar |
league_id | — | League ID(s). Supports multiple |
date | today | Starting date (YYYY-MM-DD) |
team_display | global | Team display mode: auto, auto-outlined, logo, logo_code, badge-filled, badge-outlined |
show_live_filter | yes | Show Live / Finished / Upcoming filter pills |
show_flag | yes | Show country flag next to league name |
[anwphub-calendar sport_id="1"]
[anwphub-calendar sport_id="2" team_display="logo_code" date="2026-03-15"]
[anwphub-scoreboard] — Scoreboard Slider
Horizontal carousel of mini game cards powered by Swiper.js. ESPN-style design with game status at top, team logos, and scores. Shows betting spread for upcoming games when odds are available.
| Attribute | Default | Description |
|---|---|---|
sport_id | all | Filter by sport |
season_id | — | Season ID |
league_id | — | League ID |
team_id | — | Team ID(s). Supports multiple |
status | all | finished or fixture |
days_offset | — | Days back from today (e.g. -7) |
days_offset_to | — | Days forward from today (e.g. 3) |
limit | 20 | Max games to include |
today_focus | yes | Auto-scroll carousel to today’s games on load |
autoplay | no | Auto-scroll the carousel |
loop | no | Loop back to start when reaching the end |
[anwphub-scoreboard sport_id="1" season_id="58962" status="finished" limit="30"]
[anwphub-scoreboard sport_id="1" autoplay="1" loop="1"]
[anwphub-highlights] — Video Highlights
Grid of YouTube video highlight cards with league filter pills and “Load More” pagination. Each card shows the video thumbnail, team logos, score, and date.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
season_id | — | Season ID |
league_id | — | League ID(s). Supports multiple |
team_id | — | Team ID |
limit | 12 | Videos per page |
show_league_filter | yes | Show league filter pills above the grid |
[anwphub-highlights sport_id="1" season_id="58962" limit="8"]
[anwphub-highlights sport_id="1" team_id="3419"]
Standings & Stats Shortcodes
[anwphub-standings] — Standings (Compact)
Compact standings table ideal for sidebars and narrow layouts. Shows one group at a time with sport-specific columns. Use the team_id attribute to automatically select the group containing that team.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
season_id | current | Season ID |
league_id | — | League ID |
team_id | — | Auto-selects the group containing this team |
exclude_ids | — | Team IDs to hide from the table |
group | — | Group index (0-based). Overrides team_id auto-detect |
limit | all | Max rows to display |
columns | compact | compact, standard, or full |
columns_custom | — | Comma-separated column keys for custom layout |
show_logo | no | Show team logos |
show_group_name | no | Show group name as header |
show_zones | yes | Show playoff/relegation zone colors |
show_legend | no | Show column abbreviation legend |
link_url | — | URL for a “View Full Standings” footer link |
link_text | — | Text for the footer link |
Column presets vary by sport. For basketball: compact = W, L, PCT, GB. standard adds PPG, OPP, DIFF. full adds streak. Use columns_custom to pick exactly which columns to show.
[anwphub-standings sport_id="1" season_id="58962" team_id="3419" columns="compact" show_logo="1"]
[anwphub-standings sport_id="1" season_id="58962" group="0" limit="8" link_url="/standings" link_text="Full Standings"]
[anwphub-standings-full] — Standings (Full Width)
Full-width standings showing all groups at once. Includes Home/Away toggle pills and Division/Conference/League level pills for sports with multiple tiers.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
season_id | current | Season ID |
league_id | — | League ID |
team_id | — | Highlight this team’s row |
exclude_ids | — | Team IDs to hide |
show_home_away | yes | Show Home / Away toggle pills |
show_group_name | yes | Show group headers (Eastern Conference, etc.) |
show_level_pills | yes | Show Division / Conference / League level pills |
show_legend | yes | Show column legend |
show_zones | yes | Show zone colors |
columns_custom | — | Comma-separated column keys (empty = all columns) |
[anwphub-standings-full sport_id="1" season_id="58962"]
[anwphub-standings-full sport_id="1" team_id="3419" show_home_away="0"]
[anwphub-leaders] — Stat Leaders
League-wide statistical leaders computed from your imported game data. Basketball shows hero cards for top scorers, rebounders, and assisters. Baseball shows batting and pitching leader sections.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
season_id | current | Season ID |
league_id | — | League ID |
limit | 5 | Number of leaders per category |
[anwphub-leaders sport_id="1" season_id="58962" limit="10"]
Note
Leaders are calculated from imported per-game player statistics. You need to have game details imported (with lineups/box scores enabled) for this shortcode to show data.
[anwphub-team-stats] — Team Stats Comparison
Full league-wide team stats comparison table. Shows all teams in a sortable Tabulator table with W-L records and all statistical categories for the sport.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
season_id | current | Season ID |
league_id | — | League ID |
[anwphub-team-stats sport_id="1" season_id="58962"]
[anwphub-roster] — Team Roster
Team roster displayed as a card grid grouped by position (Guards, Forwards, Centers for basketball; Pitchers, Catchers, Infielders, Outfielders for baseball).
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
team_id * | — | Team ID (required) |
[anwphub-roster sport_id="1" team_id="3419"]
Structure & Directory Shortcodes
[anwphub-bracket] — Playoff Bracket
Playoff/cup tree bracket visualization. Automatically detects whether to use a mirror layout (2-conference sports like NBA) or linear layout. Features CSS Grid connector lines, team path highlighting, champion badge, and mobile-friendly round pills.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
season_id * | — | Season ID (required) |
league_id | — | League ID |
team_id | — | Highlight this team’s path through the bracket |
show_pills | yes | Show season pills for switching between seasons |
[anwphub-bracket sport_id="1" season_id="58962"]
[anwphub-bracket sport_id="1" season_id="58962" team_id="3419"]
[anwphub-leagues] — League Directory
Country-grouped league directory with flags and links to season pages. Leagues are sorted by rank (top leagues first). Supports collapsible country groups for large league lists.
| Attribute | Default | Description |
|---|---|---|
sport_id * | — | Sport ID (required) |
group_by | country | country (open), country_collapsed (click to expand), or none |
min_rank | — | Minimum league rank to show (use 1 to hide exhibition leagues) |
show_logo | yes | Show league logos |
show_flag | big | Flag size: big (32px), medium (24px), small (16px), or empty to hide |
show_season | no | Show current season year next to league name |
item_padding | — | Left padding for league items (0-50px) |
limit | all | Max leagues to display |
[anwphub-leagues sport_id="1" min_rank="1" group_by="country_collapsed"]
[anwphub-leagues sport_id="1" show_flag="medium" show_season="1" limit="20"]
[anwphub-entity-posts] — Linked Blog Posts
Displays blog posts that have been linked to a specific entity (team, player, game, or season) via the Entity Links feature. Available in grid (image cards) or simple (text list) layout.
| Attribute | Default | Description |
|---|---|---|
entity_type | — | team, player, game, season, venue, or manager |
entity_post_id | — | WordPress post ID of the entity |
limit | 10 | Number of posts to show |
layout | grid | grid (image cards) or simple (text list) |
When used as a block in the Layout Builder, the entity_post_id is automatically set to the current entity — you only need to choose the entity type and layout. For manual shortcode usage, find the entity’s post ID in the URL when editing it under Hub Data. See Entity Links for setup instructions.
[anwphub-entity-posts entity_type="team" entity_post_id="142" layout="grid" limit="6"]
🚀 Using Shortcodes in WordPress
Block Editor (Gutenberg)
- Add a Shortcode block (in the Widgets category)
- Paste the shortcode text into the block
- Preview the page to see the rendered output
Classic Editor
Paste the shortcode directly into the editor content area. It renders on the frontend, not in the editor.
Page Builders & Widgets
Shortcodes work anywhere WordPress supports them — Elementor text widgets, Divi text modules, sidebar widgets, and theme template files via do_shortcode().
Common Attributes
These attributes are available on most shortcodes:
| Attribute | Description |
|---|---|
show_header | Show/hide the section header above the output |
header_text | Custom header text (overrides default) |
no_data_text | Message shown when no data matches the filters |
class | Additional CSS class added to the shortcode wrapper |
Sport IDs
| ID | Sport |
|---|---|
| 1 | Basketball |
| 2 | Baseball |
| 3 | Cricket |
| 4 | Rugby |
| 5 | Ice Hockey |
| 6 | American Football |
| 7 | Handball |
| 8 | Volleyball |
📚 Related
- Layout Builder — Drag-drop page layouts that can include shortcode blocks
- Entity Links — Link blog posts to entities for [anwphub-entity-posts]
- Game Pages — Full game page with all available blocks
- Team Pages — Full team page with all available blocks














