The Player Stats Panel shortcode displays comprehensive player statistics with stat blocks and optional progress bar charts. Perfect for player profile pages, Layout Builder, widgets, page builders, or PHP templates.
🎯 Shortcode
[anwp-g-player-stats-panel player_id="42"]
📸 Screenshot
✅ When to Use
Use this shortcode when:
- Building custom player profile pages
- Displaying player stats in widgets
- Using page builders (Elementor, Divi, Beaver Builder)
- Adding stats to PHP templates programmatically
- Creating dynamic stat displays with custom filtering
Don’t use when:
- You can use Gutenberg blocks instead (blocks are easier to configure)
- Displaying team rosters (use Roster (adv) block)
- Showing games (use Games Slider block)
⚙️ Parameters
Required
| Parameter | Type | Description |
|---|---|---|
player_id | Integer | Player ID to display stats for (required) |
Display Options
| Parameter | Default | Description |
|---|---|---|
stat_blocks | – | Comma-separated stat IDs to display as numbered blocks |
stat_charts | – | Stat IDs with labels for visual charts (see format below) |
season_text | auto | Custom season label (overrides auto-detection) |
notes | – | Custom notes/text below statistics |
class | – | Additional CSS classes for styling |
Query Filters
| Parameter | Default | Description |
|---|---|---|
tournament_id | – | Filter by tournament ID (supports CSV for multiple) |
stage_id | – | Filter by tournament stage ID |
season_id | – | Filter by season ID (supports CSV) |
league_id | – | Filter by league ID (supports CSV) |
filter_by_team | – | Filter by team ID |
date_from | – | Start date (format: YYYY-MM-DD) |
date_to | – | End date (format: YYYY-MM-DD) |
📊 stat_charts Format
The stat_charts parameter uses a special format to define chart labels:
stat_charts="ID,Label|ID,Label|ID-ID,Label"
Example:
stat_charts="12,Free Throw Percentage|13,2-Point Goal Percentage|14,3-Point Goal Percentage|18-19,Rebounds (Off/Def)"
12,Free Throw Percentage– Stat ID 12 with label “Free Throw Percentage”18-19,Rebounds (Off/Def)– Combined stats 18 and 19 with label- Use
|to separate multiple charts
💡 Examples
Basic Usage
[anwp-g-player-stats-panel player_id="42"]
With Stat Blocks
[anwp-g-player-stats-panel player_id="42" stat_blocks="goals,assists,games_played"]
With Charts and Blocks
[anwp-g-player-stats-panel
player_id="42"
stat_blocks="goals,assists,games_played,minutes"
stat_charts="goals,assists"]
Filtered by Season
[anwp-g-player-stats-panel
player_id="42"
season_id="8"
season_text="2024/2025 Season"
stat_blocks="goals,assists,games_played"]
Career Statistics
[anwp-g-player-stats-panel
player_id="42"
season_text="Career Statistics"
stat_blocks="goals,assists,games_played,minutes,yellow_cards,red_cards"
stat_charts="goals,assists,games_played"]
Date Range Filter
[anwp-g-player-stats-panel
player_id="42"
date_from="2025-01-01"
date_to="2025-06-30"]
🔧 Layout Builder Integration
Use the shortcode in Layout Builder with dynamic variables to automatically display stats for every player:
- Go to Sports Leagues > Layout Builder > Player
- Add Global Shortcode block to your layout
- Use dynamic variables for player and season IDs
[anwp-g-player-stats-panel player_id="%player_id%" season_id="%season_id%" stat_blocks="2,3,4,6,7,8,9,10,11,15,16,17,20,22,23,24,25" stat_charts="12,Free Throw Percentage|13,2-Point Goal Percentage|14,3-Point Goal Percentage|18-19,Rebounds (Off/Def)"]
Dynamic variables:
%player_id%– Current player’s ID (auto-filled)%season_id%– Current season ID (auto-filled)
Tip
Use stat IDs instead of names when using Layout Builder. Find stat IDs in Sports Leagues > Statistics.
🏗️ Page Builder Integration
Elementor
- Add Shortcode widget
- Paste shortcode
- Style with Elementor’s CSS options
Divi Builder
- Add Text module
- Paste shortcode in content
- Use Divi styling controls
Beaver Builder
- Add HTML module
- Paste shortcode
- Preview and save
👨💻 PHP Template Integration
Add stats to custom player profile templates:
<?php
// Get current player ID from query
$player_id = get_the_ID();
// Build shortcode dynamically
echo do_shortcode('[anwp-g-player-stats-panel player_id="' . $player_id . '" stat_blocks="goals,assists,games_played"]');
?>
🔍 Finding IDs
Player ID
Navigate to Sports Leagues > Players > Edit Player. The ID is in the URL:
.../wp-admin/post.php?post=42&action=edit
^^
Player ID
Stat IDs
Go to Sports Leagues > Statistics to find stat IDs for your sport configuration.
🆘 Troubleshooting
Shortcode displays as plain text
- Ensure you’re in “Text” tab (Classic Editor) or using Shortcode block (Gutenberg)
- Check for extra spaces around shortcode
- Verify AnWP SL Kit plugin is active
No stats showing
- Verify
player_idis correct - Check that player has stats in Sports Leagues plugin
- Ensure filters aren’t too restrictive (try removing all filters temporarily)
Wrong stats showing
- Double-check filter IDs (tournament_id, league_id, etc.)
- Verify date range format is
YYYY-MM-DD
📚 Related
- SL Kit Blocks Reference – Roster (adv), Players Slider, and other SL Kit blocks
- How to Configure Player Statistics – Setting up stats for your sport

