Sports Bench

Making keeping track of your sports league easy!

Sports Bench homepage on a laptop screen

Requires at least

4.7

Version

1.7.2

Tested up to

5.0.3

Sports Bench comes in two parts — a plugin and a theme. Both the plugin and theme work on their own; however, it’s suggested that you use both to get the most out of both products.

Plugin

Creating and keeping up with sports league stats on the internet can be a hassle. Fortunately, the Sports Bench plugin takes all of the hard work away from you. After a simple five-minute (or less) setup, you’re ready to start entering teams, players, games and even division and then watch the plugin do all of the other stuff for you. Sports Bench takes care of accumulating the stats you enter as well as the standings and schedules.

The plugin has the ability to display the standings, a scoreboard of all game for the current season and statistical leaderboards. Show off game stats next to a recap of a game. Easily create pages for teams and players. And shortcodes allow you to show game, player or team information in any post. And if you use the theme, all of this comes with minimal front-end coding work for you. You have enough to worry about with managing your sports league; let us take care of the hard part.

Theme

The Sports Bench theme is the perfect way to use the Sports Bench plugin out of the box with no need to add any code to make the core functionality work. The Sports Bench theme includes page templates for the standings, scoreboard, stats leaderboards, teams and players. It also includes the scoreboard bar, a featured post slideshow, infinite scrolling posts on the homepage and implements the longform post feature included in the Sports Bench plugin.

Sports Supported:

  • Baseball
  • Basketball
  • Football
  • Hockey
  • Rugby
  • Soccer
  • Volleyball

Features

Team Page

Plugin

Sports Bench makes it easy for you to have a centralized location for each team in the league with team pages. If you’re using the Sports Bench theme, this requires no setup. But even if you’re not, our functions and guides will have you setup with a team page template that will match your theme in no time.

Player Page

Plugin

This plugin also makes it easy for you to have a centralized location for each player in the league with player pages. If you’re using the Sports Bench theme, this requires no setup. But even if you’re not, our functions and guides will have you setup with a player page template that will match your theme in no time.

Playoffs

Plugin

You can now easily create playoff brackets to show who your league’s champion is. Create a 2, 4, 6, 8, 12, 16, 32 or 64 team single elimination bracket or a four-team double elimination bracket. And the front end display is easy. Just select the playoff shortcode, select the bracket and watch it do its work. The display is written to work with any size screen, so all of your readers will be able to see who the true champion is.

Divisions

Plugin

Sports Bench makes it easy to organize teams via conferences and/or divisions. Simply add the division or conference and then sort the teams into them.

Standings

Plugin

Show where teams are in the standings with ease. The plugin keeps track of the standings with minimal need for user input. You can show league, conference or division standings, whichever works for you.

Scoreboard

Plugin

Display upcoming, current or completed games with an easy-to-use scoreboard. You can create a separate scoreboard page with only the need to call one function, or you can add a scoreboard bar to the top of your header.

Stats Leaderboard

Plugin

Show who’s the best in different statistical categories with Sports Bench’s stats leaderboard. Simply select which stats you wish to show and they’ll show up on the page. The stats show the top ten players, but users can load more for each stat with a simple click.

Stat Search

Need to figure out what the record is for a particular stat? Need to see if anybody’s done something before? You and your visitors can search for stats with an easy-to-use player stat search. This can be used on the front and back end so anyone can look up just about any stat.

Game Recaps

Plugin

Show off stats from a game in a nice sidebar area to go along with a post. It’s perfect for a game recap, where the text or even video recap can be in the main area with the stats off to the side. The recap stats are made to be used with any sidebar to match the theme you are using.

Widgets

Plugin

Sports Bench comes with three ready-to-go widgets to display in the sidebar. You can display standings, the scoreboard and the leaderboard for a stat in the sidebar. The widgets are also created to blend with you sidebar to match the theme.

Gutenberg Blocks

Plugin

The plugin comes with custom Gutenberg blocks ready to go when the new Gutenberg editor is rolled into WordPress core. These blocks can be used to show page templates, games, playoff brackets, rivalries and more!

Shortcodes

Plugin

The plugin also comes with 11 different shortcodes that you can use to display information in a post. In the post editor, click the ‘SB’ logo to open up a modal where you can select between a game, team, player, scoreboard, standings, stats, playoff bracket, rivalry, player page, team page or game recap shortcode to display information to add to your posts.

WP REST API Integration

Plugin

JavaScript frameworks and the WP REST API are the hot thing in web development. If you’re creating a site that uses the REST API and any of the popular frameworks, Sports Bench has the tools to help you.

CSV Upload

Plugin

Already have a database set up for your league? Well we make it easy for you to bring it over and set up with Sports Bench. Simply export each table you need – divisions, games, game info, game stats, players, brackets, series and teams – and use our CSV uploaded to add the information. The CSV import page will walk you through the process to make sure you’re all set. And if you need to migrate your site, you can also export each of the tables into a CSV file to safely move the data to another site with Sports Bench or just for safe keeping.

Sports Bench Plugin Integration

Theme

The Sports Bench theme is designed and coded with the Sports Bench plugin in mind. While the theme works on its own like any other WordPress theme, it works best with the plugin. This is perfect for users with no coding experience as everything has already been taken care of. Simply activate the theme and plugin, setup the plugin options and you’re on your way.

Homepage Slider

Theme

Show off your best or most important stories with the featured post slider on the homepage. Simply select a category in the theme options and add posts to that category to see them displayed in the full-width slider. You can control how many posts are shown on the slider. The preferred image ratio is 2.56:1, with a relatively large image so that it stretches across the page.

Customizable Homepage

Theme

Readers won’t have to go very far to find your stories when they come to your website. In addition to showing your latest posts, you can also add tabs for selected categories so readers can peruse them without leaving the homepage.

Infinite Scroll

Theme

Your readers won’t have to worry about the hassle of navigating through pages of posts to find their favorite stories thanks to infinite scroll. Readers will just have to keep scrolling down in order to load more posts rather than wait for a new page to load, saving them time and frustration. This works on the home and archive pages.

Custom Header

Theme

Add your personal branding to the website with a custom logo. The logo displays on the left side of the top menu. The suggested size for the header is 200px by 40px.

Site Logo

Theme

In addition to the site header, you can also add branding with a custom site logo. The logo will appear down in the footer and can also be added into templates wherever you need it. WordPress advises that the site logo be 512px by 512px.

Social Media Links

Theme

Show off links to your social media sites in the header with ease. Simply enter the URL for the desired social media platform in the theme options and the image and links will automatically appear in the header.

Longform Template

Theme

Have a special story that you want to tell in a special way? Sports Bench makes that easy with the longform feature. Select the longform post template in the “Post Attributes” section of the post editor to see your story displayed in a unique way.

Homepage - Slider

Homepage - Tiled

Single Post

Single Post Game Recap

Single Post Game Preview

Longform Post

Page

Archives

Teams

Single Team

Players

Single Player

Standings

Stats

Scoreboard

Playoffs

Dashboard Widgets

Options Page

Custom Fields

Stats Admin Page

Standings Admin Page

Teams Admin Page

Single Team Admin Page

Players Admin Page

Single Player Admin Page

Games Admin Page

Single Game Admin Page

Playoffs Admin Page

Single Playoff Bracket Admin Page

Sports Bench Homepage with a slider
Sports Bench homepage with tiled posts
Sports Bench single post template
Sports Bench single post game recap
Sports Bench single post game preview
Sports Bench longform post template
Sports Bench page template
Sports Bench Archives Template
Sports Bench teams page
Sports Bench single team page
Sports Bench players page
Sports Bench single player page
Sports Bench standings
Sports Bench stats page
Sports Bench scoreboard page template
Sports Bench playoffs page template
Sports Bench dashboard widgets
Sports Bench options page
Sports Bench custom fields for posts
Sports Bench stats admin page
Sports Bench standings admin page
Sports Bench teams admin page
Sports Bench single team admin page
Sports Bench players admin page
Sports Bench single player admin page
Sports Bench games admin page
Sports Bench single game admin page
Sports Bench playoffs admin page
Sports Bench single playoff bracket admin page

Like what you see so far? Download this right now and get started!

Videos

How To's

Installation

Plugin

Via WordPress Dashboard
  1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the plugin only, ignore this step.
  2. In the WordPress admin area, go to Plugins->Add New. Then hit “Upload Plugin” at the top of the subsequent page.
  3. Select the zipped plugin directory (i.e. sports-bench-1.0.zip) and hit “Install Now”.
  4. After the plugin is installed, click “Activate” to start using the theme.
  5. Go to the “Setup” section of this ReadMe file to get the plugin rolling for your use.
VIia FTP Upload
  1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the plugin only, ignore this step.
  2. Unzip the zipped plugin directory (i.e. sports-bench-1.0.zip).
  3. Upload the sports-bench directory inside the now-unzipped directory to the plugin directory on your site (located inside of the wp-content directory).
  4. In the WordPress admin area, go to the Plugins page and hit “Activate” underneath the Sports Bench listing on the page to begin using the theme.
  5. Go to the “Setup” section of this ReadMe file to get the plugin rolling for your use.

Theme

Via WordPress Dashboard
  1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the theme only, ignore this step.
  2. In the WordPress admin area, go to Appearance->Themes. Click the “Add New” button at the top of the page and then hit “Upload Theme” at the top of the subsequent page.
  3. Select the zipped theme directory (i.e. sports-bench-1.0.zip) and hit Install now.
  4. After the theme is installed, click “Activate” to start using the theme.
Via FTP Upload
  1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the theme only, ignore this step.
  2. Unzip the zipped theme directory (i.e. sports-bench-1.0.zip).
  3. Upload the sports-bench directory inside the now-unzipped directory to the themes directory on your site (located inside of the wp-content directory).
  4. In the WordPress admin area, go to Appearance->Theme and hit “Activate” underneath the Sports Bench listing on the page to begin using the theme.

Setting Up Sports Bench

So now you’ve got the plugin installed and activated. Before we get too far along, we need to set up a few plugin settings so that you’re ready to go.

  1. Go to the Sports Bench Options page after activating the plugin. The link can be found in the admin menu on the left side.
  2. First, select a sport. Currently, baseball, basketball, (American) Football, Hockey and Soccer (Football) are supported. Please note that if you select a sport, comeback to the option and change it, all games will be lost.
  3. Add the current season. The default is the current year. Please make note of how you format the year(s) here. You’ll need it when you start to create games later on. Make sure to update this setting when you start a new season.
  4. Determine whether or not you want to display games by week or not. This option determines how games are shown on the scoreboard. If you don’t select this option, you can disregard the “Week” field when creating games. Otherwise, next enter the current week of the season. You’ll update this setting a lot.
  5. If you have a or want a page to show team pages, select the page that is using the team page template. This will direct team links to this page. If you haven’t created the page for the teams, you can come back to this later. We’ll get into more detail later on in the guide.
  6. If you have a or want a page to show player pages, select the page that is using the player page template. This will direct player links to this page. If you haven’t created the page for the players, you can come back to this later. We’ll get into more detail later on in the guide.

Creating a Division

All right, now we’ve got our settings taken care of we can start adding some data. At first you’ll probably be tempted to create teams right now, but most leagues divide their teams up into divisions, conferences or leagues, so let’s start there first. This way it will be much easier once we start adding teams.

  1. To start adding divisions, hover over the “Teams” item in the menu in the admin area of your site. Then click on “Divisions” in the submenu that appears.
  2. The divisions page is set up nearly identical to the categories page in WordPress where the divisions are listed on the right and you can add divisions or conferences on the left.
  3. To add a division or conference, first fill out the name of the division or conference.
  4. Then select if this is a division or a conference.
  5. If this is a conference, select the color for the conference. This is optional, but the color appears a border between the table head and table body wherever the standings appear.
  6. If this is a division, select the conference the division belongs to. The recommended practice is to add conferences first and then add divisions, if that is your set up.
  7. Then hit save. The page will reload and your new item will show up on the left. Repeat this process until all of your divisions and conferences are added.

Creating a Team

At this point we’ve installed the plugin, got the settings taken care of and added our conferences and divisions. Now it’s finally time to add in the teams.

  1. To start adding teams, hover over the “Teams” item in the admin area of your site. Then click “Add New” in the submenu that appears.
  2. Starting at the top, add the full team name (i.e. Texas Rangers, Seattle Seahawks, FC Dallas).
  3. Then enter the team location. If the team has a location and nickname, put just the city or state (i.e. Texas, Seattle). If the team has no nickname, like FC Dallas or D.C. United, put the full name here again and leave the nickname field next blank.
  4. Enter in the nickname of the team if there is one (i.e. Ranger, Seahawks).
  5. Next enter the three or four letter abbreviation of the team (i.e. TEX, SEA, FCD).
  6. Next select whether the team is active or inactive. The default setting is always active. This only changes to inactive if the team takes a hiatus or folds.
  7. Then enter the city and the state where the team is located.
  8. Next enter the stadium name and the capacity of the stadium.
  9. Then enter the name of the head coach.
  10. Next select what division or conference the team is placed in.
  11. Then enter the primary and secondary colors for the team.
  12. Next, on the right hand side, upload the team’s logo.
  13. Then you can add a photo of the team below the logo. This is an optional item.
  14. Finally, hit save at the bottom. You’ve now created your first team. Congrats! Now repeat these steps to add your remaining teams.

Creating a Player

So we’ve added our teams. Now it’s time to add our players to these teams.

  1. To start adding players, hover over the “Players” item in the admin area of your site. Then click “Add New” in the submenu that appears.
  2. Enter in the first and last name of the player.
  3. Then select the team the player plays for, or select “Free Agent” if the player has no team.
  4. Next use the date picker to select the player’s birthday.
  5. Then either enter or select the position the player page.
  6. Next add the height and weight of the player if you want to.
  7. Then enter the city and state name of the player’s hometown if you so wish.
  8. Add a photo of the player on the right side of the page, if you wish.
  9. Finally, hit save at the bottom. You’ve now created your first player. Congrats. Now repeat these steps to add your remaining players.

Creating a Game

So we’ve added our teams and their players. Now it’s time to add games to the schedule. This is the most complicated of the admin pages associated with the plugin, but if you follow these steps, you’ll have no issue adding games and game stats.

  1. To start adding games, hover over the “Games” item in the admin area of your site. Then click “Add New” in the submenu that appears.
  2. Select the home and away teams for the game.
  3. Then select whether this game is a scheduled game, a game in progress or a game that is final.
  4. If this is a game that’s in progress, another section will appear below. Here you’ll enter the current score for the home and away teams and the current time and period (or minute of the match for soccer or inning for baseball) of the game.
  5. In the game information row, enter the season the game is taking place in. If you’re sorting your games by week, add the week number. Then add the date and time of the game and the attendance of the game (if applicable).
    • If this game is listed as a scheduled game, you don’t need to go any further. Hit save right here and you’re done! You’ve added your first game. Otherwise, continue on.
  6. In this next section, add the scoreline for the game. If this is a baseball game, enter in the runs, hits, errors and men/women left on base. Otherwise, enter the scoring by quarter, period or half. The final column on the right will automatically add up the total for each team.
  7. Next add the game/match events for the game. This differs from sport to sport, but the column headings wil point you in the right direction. You can add as many game events as needed with the button at the bottom. You can also remove game events with the remove button at the end of each row.
    • Note: Basketball games do not have this section.
    • If this game is listed as an in-progress game, you don’t need to go any further. Hit save right here and you’re done! You’ve added your first game. Otherwise, continue on.
  8. Then add in the team stats for the game. Again, this differs depending on the sport, but the titles in the center will help you along.
  9. Next add in the individual player stats for the home and away teams. The players will be loaded in a dropdown on the left when you select the teams at the top. Again, the stats you’ll need to enter differ depending on the sport, but the column headings will guide you along. You can add as many players as you need with the button at the bottom of each section. You can also remove players with the remove button at the end of each row.
  10. Finally, hit the save button at the bottom of the page. You’ve now created your first game complete with all of the stats. Congrats! Now just repeat the process whenever you need to add or edit games.

Creating a Playoff Bracket

Okay so now an entire season has gone by and it’s time for playoffs. (And yes Jim Mora, we’re talking about playoffs). Sports Bench makes it easy for you to create playoff brackets to show off who your one true champion really is.

  • To add a playoff bracket, hover over the “Playoffs” item in the admin area of your site. Then click “Add New” in the submenu that appears.
  • Next give the bracket a name. Then select the number of teams that will be in the tournament, select whether it’s a single or double elimination tournament and then select the season the bracket takes place in.
  • For each playoff match up, select both teams from the dropdowns provided. Give each of them their seeding (if applicable). Then select whether this is a one, two, three, five or seven game series. Finally, select the game that applies to each game in the series from the dropdowns below.
  • Repeat the previous step until the bracket is filled out as much as it can be. The score section on the right will update automatically, but you will have to select the winners by hand like the previous step.
  • When you’re done, hit save. And that’s it. You’ve created your first playoff bracket!

Adding Scoreboard, Standings and Stats Pages

All right, so we’ve got the plugin installed and setup. We have our divisions, teams, players and some games. Now how will we display this data. Fortunately, Sports Bench makes it easy for you to display standings, scoreboards and stats leaderboards on pages (and even posts) thanks to shortcodes. This section will take you through how to do that.

  • First start a new page or post. Then click the “SB” logo near the top of the visual editor. This will open up a modal where you can select a number of different shortcodes.
  • If you want to add a scoreboard, select “Scoreboard” and then hit insert. Now when you view the page or post, a scoreboard will be displayed.
  • If you want to add standings, select “Standings” and then hit insert. Then a few options will appear below the editor. If it doesn’t appear right away, give it a few seconds. In the options, you can show league, conference and division standings and show home, away, division and conference records and points for and against and points differential. You can add and remove items if you need to using the buttons in the options.
  • If you want to add a stats leaderboard, select “Stats” and then hit insert. Then an options panel will appear below the editor. Here, you can chose which stats show up on the page. You can add as many stats as you like to the page.
  • That’s it. You can create pages that show a scoreboard, standings and stats without writing a single line of code!

Using the Shortcodes

But your shortcode options aren’t just limited to standings, you can also use shortcodes to show playoff brackets, game information, players and teams.

  • To begin using a shortcodes, first start a new page or post. Then click the “SB” logo near the top of the visual editor. This will open up a modal where you can select a number of different shortcodes.
  • If you want to add a game shortcode, select “Game” and then select a season. From there, select a game from that season. The shortcode will then show the teams competing in the game as well as the time, date and location of the game. If the game is finished and has a recap, a link to the recap will show as well.
  • If you want to add a player shortcode, select “Player” and then select a player from the list that appears. The shortcode will display the player’s photo and information and their recent stats.
  • If you want to add a team shortcode, select “Team” and then select a team from the list that appears. The shortcode will display the team’s logo and information and their recent games and upcoming schedule.
  • If you want to add a playoff shortcode, select “Playoff Brackets” and then select a playoff bracket from the list that appears. This will display the bracket in table form on the front end.
  • If you want to add a rivalry shortcode, select “Rivalry” and then select the two teams that you want to display stats for. This will display the series records between the two teams and their recent results against each other.
  • If you want to add a team page shortcode, select “Team Page”. Next, please find the “Creating a Team Page” section of the guide and follow those instructions.
  • If you want to add a player page shortcode, select “Player Page”. Next, please find the “Creating a Player Page” section of the guide and follow those instructions.
  • If you want to add a game recap shortcode, select “Game Recap” and then select the game you want to show a recap for.
  • That’s it. You can now display a lot of cool information in your posts and pages without writing a single line of code!

Using the Widgets

Want to display information that appears in the sidebar wherever your viewers go? Sports Bench has widgets so you can display a scoreboard, standings and stats on every page with a widget area.

  • Navigate to the Widgets page in the admin area.
  • To add a scoreboard widget, click and drag the “Sports Bench Scoreboard” widget to the desired widget area. Give it a title and hit “Save”. That’s it.
  • To add a standings widget, click and drag the “Sports Bench Standings” widget to the desired widget area. Give it a title, select whether it will show the league, conference or division standings and then hit “Save”. That’s it.
  • To add a stats widget, click and drag the “Sports Bench Statistic” widget to the desired widget area. Give it a title, select which statistic to show and then hit “Save”. That’s it.

Setting Up the Teams Page Template

Okay so you’ve created a new page template and shown player information. Now we’re going to do the same for teams, but the level of difficulty is going to go up a bit. But don’t worry. Once again, if you follow these directions, you’ll be feeling like a real programmer by the time it’s over. And if you want, there’s a shortcode you can use to create the team page instead.

Using the Team Page Shortcode

  1. First, create a new page. Then in the new page create a new shortcode. To do this, click the “SB” button in the TinyMCE editor at the top.
  2. In the window that now appears, select “Team Page” and then insert. Then hit “Publish”.
  3. Next, navigate to the Sports Bench Options page. It should be in the menu on the left in the admin.
  4. In the options page, select your new page for the Team Page option and then hit save.
  5. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
  6. And that’s it. Your team page is ready to go. And you didn’t even need to write a single line of code.

Using a Team Page Template

Introducing the Team Class

Before we get going too far, let’s introduce the Sports_Bench_Team class. Once again, if you’re not too familiar with PHP or object-oriented programming, just know that adding the following to your code essentially calls the team from the database and populates it attributes without you having to write more code.

<?php $team = new Sports_Bench_Team( (int){{team_id}} ); ?>

Note that the team id will need to be an actual integer number. From here, you can get the team name, location and so much more. In fact, here’s a list of the available attributes you can call, plus one function we’ll use to set up this page.

  • $team->team_id
  • $team->team_name
  • $team->team_location
  • $team->team_nickname
  • $team->team_abbreviation
  • $team->team_active
  • $team->team_city
  • $team->team_state
  • $team->team_stadium
  • $team->team_stadium_capacity
  • $team->team_head_coach
  • $team->team_logo
  • $team->team_photo
  • $team->team_division
  • $team->team_primary_color
  • $team->team_secondary_color
  • $team->player_slug
  • $team->team_slug
  • $team->get_schedule()
  • $team->get_roster()
  • $team->get_team_photo()
  • $team->get_division_name()

So now that we’ve gone over something we’ll be using here, let’s start building the player page, shall we? If you want to learn more about the Player class and the other classes, please visit the codex page on the Sports Bench website.

Building the Team Page

Like the player page, creating the team page involves creating a new page template. It’s a simple concept in WordPress, but if you’re unfamiliar with it, you can read this, this and this tutorial on how to do that. Otherwise, let’s get started.

  1. So first off, create a new page template in your theme’s main directory. Name it page-team.php
  2. Next, copy the contents of your theme’s page.php file and paste it into this new page template file.
  3. At the top underneath the opening php tag, paste the following: Template Name: Team
  4. Now, this is where things get a bit trickier. In this file, look for the get_sidebar() function. If this is wrapped in a div tag that has a class or id of “widget” or sidebar, then don’t do anything with it. Otherwise, find your theme’s sidebar.php In this file look for a div tag with a class or id of “widget” or “sidebar”. Copy this div and paste it in the new template file above the get_sidebar function. Make sure the closing </div> tag is there as well.
  5. Once you’ve done that, take a quick breather. We’re going to divide the rest of this into two parts: the main body and the sidebar.

Building the Main Body of the Page

  1. Like the player page, find the loop and delete everything within either a main or article div. Then inside of that, paste the following lines of code:
    					<?php if ( class_exists( 'Sports_Bench_Team' ) ) { ?>
    						<?php if ( get_query_var( 'team_slug' ) ) { ?>
    						<?php } else { ?>
    						<?php } ?>
    					<?php } ?>
    
  2. Then inside the else part of the statement, paste the following code: <?php echo sports_bench_show_team_listing(); ?>.
  3. The rest of this section will deal with code going inside the <?php if ( class_exists( 'Sports_Bench_Team' ) ) { ?> section.
  4. To show the team photo, insert the following lines:
    				<div class="team-photo">
                    	<?php echo $team->get_team_photo( 'team-photo' ); ?>
    				</div>
    
  5. To show the team logo, insert the following lines:
    					<div class="team-logo">
    						<?php echo $team->get_team_photo( 'team-logo' ); ?>
    					</div>
    
  6. To show the team name, insert the following lines:
    					<div class="team-name">
    						<h1 class="team-title" style="color:<?php echo $team->team_primary_color; ?>"><?php echo $team->team_name ?></h1>
    					</div>
    
  7. Then, to show the team stats, insert the following lines:
    				<div id="team-stats" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
    					<h4><?php echo get_option( 'sports-bench-season-year' ) . ' ' . __( 'Stats', 'sports-bench' ); ?></h4>
    					<?php echo sports_bench_get_players_stats_table( sports_bench_get_players_stats( $team->team_id,  '"' . get_option( 'sports-bench-season-year' ) . '"' ) ); ?>
    				</div>
    
  8. Finally, to show the team’s roster, insert the following lines:
    				<div id="team-roster" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
    					<h4><?php _e( 'Roster', 'sports-bench' ); ?></h4>
    					<?php echo sports_bench_show_roster( $team->team_id ); ?>
    				</div>
    
  9. All right, that’s it for the main body of the page template. Now let’s finish off the template with the sidebar.

Adding in the Sidebar

This part will be a bit challenging, but again, if you follow the directions here, you’ll do just fine. If you want, you can use this code to sort of give you a guide through what it should look like.

  1. First we need to add a conditional to see if this is a page for a single team or not. So where the get_sidebar function is in your page template, place the lines of code below. If the function is wrapped in a div with a class of “widgets” or “sidebar”, place this code inside that div and disregard that same div in the following code.
    				<?php if ( isset( $team ) ) { ?>
    					<div id="sidebar1" class="sidebar">
    					</div>
    				<?php } else { ?>
    					<?php get_sidebar(); ?>
    				<?php } ?>
    

    It should go without saying that this will replace the original get_sidebar function in your template file.

  2. The remainder of the code will go inside the <?php if ( isset( $team ) ) { ?> section. Now, to show the schedule, place the following lines of code:
    				<aside id="schedule-info" class="widget" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
                    	<h4 class="widgettitle"><?php echo $team->team_name . ' ' . get_theme_mod( 'sports-bench-season-year' ) . ' ' . __( 'Schedule', 'sports-bench' ); ?></h4>
    					<?php echo sports_bench_show_team_schedule( $team->team_id ); ?>
                    </aside>
    
  3. To show the division or conference standings for the team, place the following lines of code:
    				<aside id="standings" class="widget" style="border-top: 2px solid <?php echo $team->team_secondary_color; ?>">
                        <?php global $wpdb;
                        $table = $wpdb->prefix . 'sb_divisions';
                        $querystr = "SELECT * FROM $table WHERE division_id = $team->team_division;";
                        $division = $wpdb->get_results($querystr);
                        $division_title = $division[ 0 ]->division_name . ' ' . __( 'Standings', 'sports-bench' ); ?>
                        <h4 class="widgettitle"><?php echo $division_title; ?></h4>
    					<?php echo sports_bench_team_division_standings( $team->team_division ); ?>
                    </aside>
    
  4. Finally, to show some more team information, add the following lines of code:
    				<aside id="team-info" class="widget clearfix" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
                        <h4 class="widgettitle"><?php _e( 'Team Info', 'sports-bench' ); ?></h4>
    					<?php echo sports_bench_show_team_info( $team->team_id ); ?>
                    </aside>
    

Setting up the Team Template

Okay, we’re almost done with the team page template, but now we need to add the actual page to the site.

  1. Create a new page and name it “Teams”.
  2. On the right-hand side, look for “Page Attributes”. Then select “Team”. Then hit publish.
  3. Next, go to Sports Bench Settings. Find the Team Page setting and then select this newly created page. Hit “Publish”.
  4. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
  5. Now navigate to your newly created team page and enjoy your hard work. You deserve it.

That’s it! You’ve now completed creating a template for the teams in your league. It’s now a one-stop-shop for all team information. Confidence in your coding skills continuing to go up? Great! We’re about to take another step up in difficulty. But you’ll do fine.

Setting Up the Players Page Template

Okay, so you’re almost complete getting everything going with your website and Sports Bench. But now we’re getting into the challenging part. However, there’s good news. With Sports Bench 1.3, you can add a player page template with a simple shortcode. Or you can learn and dig into the code and do it that way. Both ways will be shown here.

Using the Player Page Shortcode

  1. First, create a new page. Then in the new page create a new shortcode. To do this, click the “SB” button in the TinyMCE editor at the top.
  2. In the window that now appears, select “Player Page” and then insert. Then hit “Publish”.
  3. Next, navigate to the Sports Bench Options page. It should be in the menu on the left in the admin.
  4. In the options page, select your new page for the Player Page option and then hit save.
  5. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
  6. And that’s it. Your player page is ready to go. And you didn’t even need to write a single line of code.

Using a Player Page Template

Introducing the Player Class

Before we get going too far, let’s introduce a simple concept that you’ll use here and elsewhere if you want to customize your site even further. Sports Bench comes with three classes: Sports_Bench_Game, Sports_Bench_Player and Sports_Bench_Teams. Here we’ll just look at the player class. If you’re not too familiar with PHP or object-oriented programming, just know that adding the following to your code essentially calls the player from the database and populates it attributes without you having to write more code.

<?php $player = new Sports_Bench_Player( (int){{player_id}} ); ?>

Note that the player id will need to be an actual integer number. From here, you can get the player’s first name, last name and so much more. In fact, here’s a list of the available attributes you can call, plus one function we’ll use to set up this page.

  • $player->player_id
  • $player->player_first_name
  • $player->player_last_name
  • $player->player_photo
  • $player->player_position
  • $player->player_home_city
  • $player->player_home_state
  • $player->player_date_of_birth
  • $player->team_id
  • $player->player_weight
  • $player->player_height
  • $player->player_slug
  • $player->get_player_photo()

So now that we’ve gone over something we’ll be using here, let’s start building the player page, shall we? If you want to learn more about the Player class and the other classes, please visit the codex page on the Sports Bench website.

Building the Player Page

So creating the player page involves creating a new page template. It’s a simple concept in WordPress, but if you’re unfamiliar with it, you can read this, this and this tutorial on how to do that. Otherwise, let’s get started.

  1. So first off, create a new page template in your theme’s main directory. Name it page-player.php
  2. Next, copy the contents of your theme’s page.php file and paste it into this new page template file.
  3. At the top underneath the opening php tag, paste the following: Template Name: Player
  4. Look at the body of your new page template’s contents. First find the Loop. If you’re unfamiliar with the loop, look for a section that looks like if ( have_posts() ) : while( have_posts() ) : the_post();. Inside of that, look for a <main> or <article> tag and delete everything inside of that.
  5. Replace the now-deleted code with the following:
    				<?php if ( class_exists( 'Sports_Bench_Player' ) ) { ?>
    					<?php if ( get_query_var( 'player_slug' ) ) { ?>
    					<?php } else { ?>
    					<?php } ?>
    				<?php } ?>
    
  6. From here, let’s get the simple part out of the way first. Inside the else statement, place the following line of code: <?php echo sports_bench_show_team_player_select(); ?> This will show a dropdown of teams to pick players from if there’s no player slug in the url. For a live look at what this does, click here.
  7. With that out of the way, let’s get to the fun part. Inside of the if ( get_query_var( 'player_slug' ) ) statement, first add the following:
    				<? if ( get_query_var( 'player_slug' ) ) {
    				$player = new Sports_Bench_Player(get_query_var('player_slug'));
    				$team = new Sports_Bench_Team((int)$player->team_id);
    				} ?>
    
    				<div class="player-info">
    					<?php echo sports_bench_show_player_info( $player->player_id ); ?>
    				</div>
    

    This will display the player’s photo and his/her name, height, weight, position, age and hometown if those are entered. You might have to do some styling to get the section to match your theme’s style.

  8. Finally, below the code you just pasted, place the following lines of code:
    				<div id="player-stats" class="widget" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
    					<h4 class="widgettitle"><?php echo __( 'Career Stats', 'sports-bench' ); ?></h4>
    					<?php echo sports_bench_get_season_stats( $player ); ?>
    				</div>
    

    This will show a table of the player’s career stats by season. And if you click on a season, you’ll see the game-by-game stats. And the best part, that functionality requires no code from you.

  9. Now, go create a new page. Title it “Players”. Then go down on the right side of the editor to the “Page Attributes” section and select “Player” from the page template dropdown.
  10. Next, go to the Sports Bench Settings page inside the Customizer. Then find the Player Page option and select the page you’ve just created. Then hit publish.
  11. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
  12. Then navigate to that page. You should now see the dropdown. Pick a team and then click on a player. And now you should see his/her player page.

And that’s it! You’ve survived some intermediate coding and you’ve created a really cool player page that you can show off. You’re harnessing the power of Sports Bench. Confidence going up? Good. We’re going to take another step higher in the next section. But for now, admire your work.

Adding Game Recaps and Previews

We are so close to the finish line. You’re doing great, but now we’ve reached our toughest challenge yet. However, with this as your guide, you’ll be done with it in no time. This section deals with post templates. Introduced in WordPress 4.7, post templates work the same as page template, but obviously with post types and an extra line of code. This is also why WordPress 4.7 is required for this plugin. This section will cover creating game preview and game recap post templates. We’ll start easy first with game previews.

Creating the Game Preview Template

There are two ways you can create game previews. The easiest is to use the “Game” shortcode. To do this, add a new post and then hit the “SB” at the top of the editor. Then select game and then the game you want to show. And that’s all you need. If you want to create a custom post template for previews, use the directions below.

  1. Like the player and team templates, create a new php file and name it page-game-preview.php. But now, copy the contents of your theme’s single.php file. And we’re also going to leave the loop untouched. Our focus is on the sidebar.
  2. Again, like the player team templates, add the following lines of code to right after the opening php tag. Note the extra line which helps WordPress realize that this is intended for posts and not pages.
    				Template Name: Game Preview
    				Template Post Type: post
    
  3. Now that that’s taken care of, let’s turn our attention to the sidebar. Again, locate where the get_sidebar function. If it’s wrapped in a div with a class of “sidebar” or “widgets” or something of the like, you have nothing to worry about. The lines of code we’ll write later on will go right before this function. Otherwise, locate your theme’s sidebar.php file. Copy the lines of code that control the primary sidebar and replace the get_sidebar function in the template with the copied code. It might look something like this:
    				<div id="sidebar1" class="sidebar>
    					<?php if ( is_active_sidebar( 'sidebar1' ) ) : ?>
    						<?php dynamic_sidebar( 'sidebar1' ); ?>
    					<?php endif; ?>
    				</div>
    

    Note: Your sidebar.php file probably won’t look exactly like this. This is more a guide. It should, however, at least look something like it if it’s up to WordPress standards.

  4. Now, right before either the code you just pasted or the get_sidebar functions, add in the following lines of code to add a game preview “widget”. This will show the teams’ records, names and logos as well as the date, time and location of the game. If the game is final, the score will show. And if the game has a recap, a link to the recap will show as well.
    				<?php echo sports_bench_show_game_preview_info(); ?>
    
  5. So that’s all of the coding we have to do for the preview template. Now let’s add a preview. To start, add a new page. Then type a preview into the main post editor.
  6. Once you are done, go the “Post Attributes” section on the right-hand side. Select “Game Preview” from the post template dropdown. next, find the custom fields for Sports Bench. It’ll be below the main editor somewhere, depending on what plugins you have installed. There, select “Preview” and then select which game this is a preview for.
  7. Now hit “Publish” and then hit “View Post”. And that’s it. You’ve created a really cool game preview post template that adds necessary info with minimal effort from you in the future. Congrats! Now let’s move on to game recaps.

Creating the Game Recap Template

There are two ways you can create game recap areas. The easiest is to use the game recap shortcode. To do this, add a new post and then hit the “SB” at the top of the editor. Then select “Game Recap” and then the game you want to show. And that’s all you need. If you want to create a custom post template for recaps, use the directions below.

  1. Like the game preview template, create a new php file and name it page-game-recap.php and copy the contents of your theme’s single.php file into the new template.
  2. Like the game preview template, add the following lines of code right after the opening php tag:
    				Template Name: Game Recap
    				Template Post Type: post
    
  3. Again, let’s turn our attention to where the get_sidebar function is located. If it’s inside a div with the class “sidebar” or “widgets” or the like, simply delete the function since we’re overriding the default sidebar here. Otherwise, go to the sidebar.php file and copy the div that contains the actual sidebar. You don’t need any inside that div, just the outer shell. Then paste that over the get_sidebar function in the recap template.
  4. Now, inside the sidebar container that was either already there or just pasted, place the following line of code:
    				<?php echo sports_bench_show_game_stats_info(); ?>
    
  5. So that’s all the coding you have to do. But let’s add a recap just to test it out. To start go add add a new post and put some text into the main text editor.
  6. Next, scroll down on the right-hand side and find the “Post Attributes” section. Select “Game Recap” as the post template.
  7. Then find the Sports Bench custom fields. This will be somewhere below the main post editor depending on what plugins you have on your site. There select “Recap” and then select the game the recap is for.
  8. Finally, hit publish and then view the post. Congrats! You’ve now created a recap template that will show off all sorts of information from the scoreline to the team stats to the individual stats. It looks awesome.

And that’s all the code you need to get started. The best part is now, when you create a preview or a recap for a game, the link to that post will automatically show up on the team page and where the game is located on the scoreboard. It adds that extra functionality that takes your site to the next level.

Customizations

It is possible to make customization, both in the code in style. The recommended way is to make your own customization plugin so that your changes aren’t overwritten by an update. Here’s how to do that:

  1. Find the plugins directory on your web hosting and create a new directory inside of it. Call the new file ‘sports-bench-customizations’.
  2. Inside of the new directory, create a php file name sports-bench-customizations.php.
  3. Inside of the file, paste the following at the top:
    • <?php
                         /*
                         Plugin Name: Sports Bench Customizations
                         Plugin URI:
                         Description: A place to put customizations for the Sports Bench plugin
                         Version:     1.0
                         Author:
                         Author URI:
                         License:     GPL3
                         License URI: https://www.gnu.org/licenses/gpl-3.0.html
                         */
                         ?>
  4. Inside of this directory, you can include JavaScript, CSS, and other items and then call them from the php file. You can also create custom functions as well.
  5. Make sure to activate the plugin as you would any other plugin.

Setting Up the Homepage

Setting up the homepage to run as it should is a fairly quick process.

  1. Navigate to the “Customize” page in the admin. Then click “Theme Settings”.
  2. Determine if you want to hide sticky posts in the slider and home page.
  3. Determine the category to show in the slider. The suggested practice is to create a “top story” category and use that.
  4. Determine the categories to show below the slider. Each category will show up as a tab, as well as a tab with all of the latest posts.

That’s it. The theme is all set up to run as you like.

Creating a Longform Post

Creating a longform story is simple with WordPress 4.7 and the Sports Bench theme; however, for this to work, you must be using WordPress 4.7.

  • Create a post like you normally would. Typically, longform stories are over 1,000 words long, but any length will do for you.
  • Before hitting publish, scroll down to the “Post Attributes” box in the right sidebar of the page and select “Longform”.
  • Make sure you upload a large featured image as it will display across the top of the page.
  • Installation

    Plugin

    Via WordPress Dashboard
    1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the plugin only, ignore this step.
    2. In the WordPress admin area, go to Plugins->Add New. Then hit “Upload Plugin” at the top of the subsequent page.
    3. Select the zipped plugin directory (i.e. sports-bench-1.0.zip) and hit “Install Now”.
    4. After the plugin is installed, click “Activate” to start using the theme.
    5. Go to the “Setup” section of this ReadMe file to get the plugin rolling for your use.
    VIia FTP Upload
    1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the plugin only, ignore this step.
    2. Unzip the zipped plugin directory (i.e. sports-bench-1.0.zip).
    3. Upload the sports-bench directory inside the now-unzipped directory to the plugin directory on your site (located inside of the wp-content directory).
    4. In the WordPress admin area, go to the Plugins page and hit “Activate” underneath the Sports Bench listing on the page to begin using the theme.
    5. Go to the “Setup” section of this ReadMe file to get the plugin rolling for your use.

    Theme

    Via WordPress Dashboard
    1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the theme only, ignore this step.
    2. In the WordPress admin area, go to Appearance->Themes. Click the “Add New” button at the top of the page and then hit “Upload Theme” at the top of the subsequent page.
    3. Select the zipped theme directory (i.e. sports-bench-1.0.zip) and hit Install now.
    4. After the theme is installed, click “Activate” to start using the theme.
    Via FTP Upload
    1. If you purchased the plugin/theme package, unzip the “sports-bench” directory that comes with the download. If you purchased the theme only, ignore this step.
    2. Unzip the zipped theme directory (i.e. sports-bench-1.0.zip).
    3. Upload the sports-bench directory inside the now-unzipped directory to the themes directory on your site (located inside of the wp-content directory).
    4. In the WordPress admin area, go to Appearance->Theme and hit “Activate” underneath the Sports Bench listing on the page to begin using the theme.
  • Setting Up Sports Bench

    So now you’ve got the plugin installed and activated. Before we get too far along, we need to set up a few plugin settings so that you’re ready to go.

    1. Go to the Sports Bench Options page after activating the plugin. The link can be found in the admin menu on the left side.
    2. First, select a sport. Currently, baseball, basketball, (American) Football, Hockey and Soccer (Football) are supported. Please note that if you select a sport, comeback to the option and change it, all games will be lost.
    3. Add the current season. The default is the current year. Please make note of how you format the year(s) here. You’ll need it when you start to create games later on. Make sure to update this setting when you start a new season.
    4. Determine whether or not you want to display games by week or not. This option determines how games are shown on the scoreboard. If you don’t select this option, you can disregard the “Week” field when creating games. Otherwise, next enter the current week of the season. You’ll update this setting a lot.
    5. If you have a or want a page to show team pages, select the page that is using the team page template. This will direct team links to this page. If you haven’t created the page for the teams, you can come back to this later. We’ll get into more detail later on in the guide.
    6. If you have a or want a page to show player pages, select the page that is using the player page template. This will direct player links to this page. If you haven’t created the page for the players, you can come back to this later. We’ll get into more detail later on in the guide.
  • Creating a Division

    All right, now we’ve got our settings taken care of we can start adding some data. At first you’ll probably be tempted to create teams right now, but most leagues divide their teams up into divisions, conferences or leagues, so let’s start there first. This way it will be much easier once we start adding teams.

    1. To start adding divisions, hover over the “Teams” item in the menu in the admin area of your site. Then click on “Divisions” in the submenu that appears.
    2. The divisions page is set up nearly identical to the categories page in WordPress where the divisions are listed on the right and you can add divisions or conferences on the left.
    3. To add a division or conference, first fill out the name of the division or conference.
    4. Then select if this is a division or a conference.
    5. If this is a conference, select the color for the conference. This is optional, but the color appears a border between the table head and table body wherever the standings appear.
    6. If this is a division, select the conference the division belongs to. The recommended practice is to add conferences first and then add divisions, if that is your set up.
    7. Then hit save. The page will reload and your new item will show up on the left. Repeat this process until all of your divisions and conferences are added.
  • Creating a Team

    At this point we’ve installed the plugin, got the settings taken care of and added our conferences and divisions. Now it’s finally time to add in the teams.

    1. To start adding teams, hover over the “Teams” item in the admin area of your site. Then click “Add New” in the submenu that appears.
    2. Starting at the top, add the full team name (i.e. Texas Rangers, Seattle Seahawks, FC Dallas).
    3. Then enter the team location. If the team has a location and nickname, put just the city or state (i.e. Texas, Seattle). If the team has no nickname, like FC Dallas or D.C. United, put the full name here again and leave the nickname field next blank.
    4. Enter in the nickname of the team if there is one (i.e. Ranger, Seahawks).
    5. Next enter the three or four letter abbreviation of the team (i.e. TEX, SEA, FCD).
    6. Next select whether the team is active or inactive. The default setting is always active. This only changes to inactive if the team takes a hiatus or folds.
    7. Then enter the city and the state where the team is located.
    8. Next enter the stadium name and the capacity of the stadium.
    9. Then enter the name of the head coach.
    10. Next select what division or conference the team is placed in.
    11. Then enter the primary and secondary colors for the team.
    12. Next, on the right hand side, upload the team’s logo.
    13. Then you can add a photo of the team below the logo. This is an optional item.
    14. Finally, hit save at the bottom. You’ve now created your first team. Congrats! Now repeat these steps to add your remaining teams.
  • Creating a Player

    So we’ve added our teams. Now it’s time to add our players to these teams.

    1. To start adding players, hover over the “Players” item in the admin area of your site. Then click “Add New” in the submenu that appears.
    2. Enter in the first and last name of the player.
    3. Then select the team the player plays for, or select “Free Agent” if the player has no team.
    4. Next use the date picker to select the player’s birthday.
    5. Then either enter or select the position the player page.
    6. Next add the height and weight of the player if you want to.
    7. Then enter the city and state name of the player’s hometown if you so wish.
    8. Add a photo of the player on the right side of the page, if you wish.
    9. Finally, hit save at the bottom. You’ve now created your first player. Congrats. Now repeat these steps to add your remaining players.
  • Creating a Game

    So we’ve added our teams and their players. Now it’s time to add games to the schedule. This is the most complicated of the admin pages associated with the plugin, but if you follow these steps, you’ll have no issue adding games and game stats.

    1. To start adding games, hover over the “Games” item in the admin area of your site. Then click “Add New” in the submenu that appears.
    2. Select the home and away teams for the game.
    3. Then select whether this game is a scheduled game, a game in progress or a game that is final.
    4. If this is a game that’s in progress, another section will appear below. Here you’ll enter the current score for the home and away teams and the current time and period (or minute of the match for soccer or inning for baseball) of the game.
    5. In the game information row, enter the season the game is taking place in. If you’re sorting your games by week, add the week number. Then add the date and time of the game and the attendance of the game (if applicable).
      • If this game is listed as a scheduled game, you don’t need to go any further. Hit save right here and you’re done! You’ve added your first game. Otherwise, continue on.
    6. In this next section, add the scoreline for the game. If this is a baseball game, enter in the runs, hits, errors and men/women left on base. Otherwise, enter the scoring by quarter, period or half. The final column on the right will automatically add up the total for each team.
    7. Next add the game/match events for the game. This differs from sport to sport, but the column headings wil point you in the right direction. You can add as many game events as needed with the button at the bottom. You can also remove game events with the remove button at the end of each row.
      • Note: Basketball games do not have this section.
      • If this game is listed as an in-progress game, you don’t need to go any further. Hit save right here and you’re done! You’ve added your first game. Otherwise, continue on.
    8. Then add in the team stats for the game. Again, this differs depending on the sport, but the titles in the center will help you along.
    9. Next add in the individual player stats for the home and away teams. The players will be loaded in a dropdown on the left when you select the teams at the top. Again, the stats you’ll need to enter differ depending on the sport, but the column headings will guide you along. You can add as many players as you need with the button at the bottom of each section. You can also remove players with the remove button at the end of each row.
    10. Finally, hit the save button at the bottom of the page. You’ve now created your first game complete with all of the stats. Congrats! Now just repeat the process whenever you need to add or edit games.
  • Creating a Playoff Bracket

    Okay so now an entire season has gone by and it’s time for playoffs. (And yes Jim Mora, we’re talking about playoffs). Sports Bench makes it easy for you to create playoff brackets to show off who your one true champion really is.

    • To add a playoff bracket, hover over the “Playoffs” item in the admin area of your site. Then click “Add New” in the submenu that appears.
    • Next give the bracket a name. Then select the number of teams that will be in the tournament, select whether it’s a single or double elimination tournament and then select the season the bracket takes place in.
    • For each playoff match up, select both teams from the dropdowns provided. Give each of them their seeding (if applicable). Then select whether this is a one, two, three, five or seven game series. Finally, select the game that applies to each game in the series from the dropdowns below.
    • Repeat the previous step until the bracket is filled out as much as it can be. The score section on the right will update automatically, but you will have to select the winners by hand like the previous step.
    • When you’re done, hit save. And that’s it. You’ve created your first playoff bracket!
  • Adding Scoreboard, Standings and Stats Pages

    All right, so we’ve got the plugin installed and setup. We have our divisions, teams, players and some games. Now how will we display this data. Fortunately, Sports Bench makes it easy for you to display standings, scoreboards and stats leaderboards on pages (and even posts) thanks to shortcodes. This section will take you through how to do that.

    • First start a new page or post. Then click the “SB” logo near the top of the visual editor. This will open up a modal where you can select a number of different shortcodes.
    • If you want to add a scoreboard, select “Scoreboard” and then hit insert. Now when you view the page or post, a scoreboard will be displayed.
    • If you want to add standings, select “Standings” and then hit insert. Then a few options will appear below the editor. If it doesn’t appear right away, give it a few seconds. In the options, you can show league, conference and division standings and show home, away, division and conference records and points for and against and points differential. You can add and remove items if you need to using the buttons in the options.
    • If you want to add a stats leaderboard, select “Stats” and then hit insert. Then an options panel will appear below the editor. Here, you can chose which stats show up on the page. You can add as many stats as you like to the page.
    • That’s it. You can create pages that show a scoreboard, standings and stats without writing a single line of code!
  • Using the Shortcodes

    But your shortcode options aren’t just limited to standings, you can also use shortcodes to show playoff brackets, game information, players and teams.

    • To begin using a shortcodes, first start a new page or post. Then click the “SB” logo near the top of the visual editor. This will open up a modal where you can select a number of different shortcodes.
    • If you want to add a game shortcode, select “Game” and then select a season. From there, select a game from that season. The shortcode will then show the teams competing in the game as well as the time, date and location of the game. If the game is finished and has a recap, a link to the recap will show as well.
    • If you want to add a player shortcode, select “Player” and then select a player from the list that appears. The shortcode will display the player’s photo and information and their recent stats.
    • If you want to add a team shortcode, select “Team” and then select a team from the list that appears. The shortcode will display the team’s logo and information and their recent games and upcoming schedule.
    • If you want to add a playoff shortcode, select “Playoff Brackets” and then select a playoff bracket from the list that appears. This will display the bracket in table form on the front end.
    • If you want to add a rivalry shortcode, select “Rivalry” and then select the two teams that you want to display stats for. This will display the series records between the two teams and their recent results against each other.
    • If you want to add a team page shortcode, select “Team Page”. Next, please find the “Creating a Team Page” section of the guide and follow those instructions.
    • If you want to add a player page shortcode, select “Player Page”. Next, please find the “Creating a Player Page” section of the guide and follow those instructions.
    • If you want to add a game recap shortcode, select “Game Recap” and then select the game you want to show a recap for.
    • That’s it. You can now display a lot of cool information in your posts and pages without writing a single line of code!
  • Using the Widgets

    Want to display information that appears in the sidebar wherever your viewers go? Sports Bench has widgets so you can display a scoreboard, standings and stats on every page with a widget area.

    • Navigate to the Widgets page in the admin area.
    • To add a scoreboard widget, click and drag the “Sports Bench Scoreboard” widget to the desired widget area. Give it a title and hit “Save”. That’s it.
    • To add a standings widget, click and drag the “Sports Bench Standings” widget to the desired widget area. Give it a title, select whether it will show the league, conference or division standings and then hit “Save”. That’s it.
    • To add a stats widget, click and drag the “Sports Bench Statistic” widget to the desired widget area. Give it a title, select which statistic to show and then hit “Save”. That’s it.
  • Setting Up the Teams Page Template

    Okay so you’ve created a new page template and shown player information. Now we’re going to do the same for teams, but the level of difficulty is going to go up a bit. But don’t worry. Once again, if you follow these directions, you’ll be feeling like a real programmer by the time it’s over. And if you want, there’s a shortcode you can use to create the team page instead.

    Using the Team Page Shortcode

    1. First, create a new page. Then in the new page create a new shortcode. To do this, click the “SB” button in the TinyMCE editor at the top.
    2. In the window that now appears, select “Team Page” and then insert. Then hit “Publish”.
    3. Next, navigate to the Sports Bench Options page. It should be in the menu on the left in the admin.
    4. In the options page, select your new page for the Team Page option and then hit save.
    5. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
    6. And that’s it. Your team page is ready to go. And you didn’t even need to write a single line of code.

    Using a Team Page Template

    Introducing the Team Class

    Before we get going too far, let’s introduce the Sports_Bench_Team class. Once again, if you’re not too familiar with PHP or object-oriented programming, just know that adding the following to your code essentially calls the team from the database and populates it attributes without you having to write more code.

    <?php $team = new Sports_Bench_Team( (int){{team_id}} ); ?>

    Note that the team id will need to be an actual integer number. From here, you can get the team name, location and so much more. In fact, here’s a list of the available attributes you can call, plus one function we’ll use to set up this page.

    • $team->team_id
    • $team->team_name
    • $team->team_location
    • $team->team_nickname
    • $team->team_abbreviation
    • $team->team_active
    • $team->team_city
    • $team->team_state
    • $team->team_stadium
    • $team->team_stadium_capacity
    • $team->team_head_coach
    • $team->team_logo
    • $team->team_photo
    • $team->team_division
    • $team->team_primary_color
    • $team->team_secondary_color
    • $team->player_slug
    • $team->team_slug
    • $team->get_schedule()
    • $team->get_roster()
    • $team->get_team_photo()
    • $team->get_division_name()

    So now that we’ve gone over something we’ll be using here, let’s start building the player page, shall we? If you want to learn more about the Player class and the other classes, please visit the codex page on the Sports Bench website.

    Building the Team Page

    Like the player page, creating the team page involves creating a new page template. It’s a simple concept in WordPress, but if you’re unfamiliar with it, you can read this, this and this tutorial on how to do that. Otherwise, let’s get started.

    1. So first off, create a new page template in your theme’s main directory. Name it page-team.php
    2. Next, copy the contents of your theme’s page.php file and paste it into this new page template file.
    3. At the top underneath the opening php tag, paste the following: Template Name: Team
    4. Now, this is where things get a bit trickier. In this file, look for the get_sidebar() function. If this is wrapped in a div tag that has a class or id of “widget” or sidebar, then don’t do anything with it. Otherwise, find your theme’s sidebar.php In this file look for a div tag with a class or id of “widget” or “sidebar”. Copy this div and paste it in the new template file above the get_sidebar function. Make sure the closing </div> tag is there as well.
    5. Once you’ve done that, take a quick breather. We’re going to divide the rest of this into two parts: the main body and the sidebar.

    Building the Main Body of the Page

    1. Like the player page, find the loop and delete everything within either a main or article div. Then inside of that, paste the following lines of code:
      					<?php if ( class_exists( 'Sports_Bench_Team' ) ) { ?>
      						<?php if ( get_query_var( 'team_slug' ) ) { ?>
      						<?php } else { ?>
      						<?php } ?>
      					<?php } ?>
      
    2. Then inside the else part of the statement, paste the following code: <?php echo sports_bench_show_team_listing(); ?>.
    3. The rest of this section will deal with code going inside the <?php if ( class_exists( 'Sports_Bench_Team' ) ) { ?> section.
    4. To show the team photo, insert the following lines:
      				<div class="team-photo">
                      	<?php echo $team->get_team_photo( 'team-photo' ); ?>
      				</div>
      
    5. To show the team logo, insert the following lines:
      					<div class="team-logo">
      						<?php echo $team->get_team_photo( 'team-logo' ); ?>
      					</div>
      
    6. To show the team name, insert the following lines:
      					<div class="team-name">
      						<h1 class="team-title" style="color:<?php echo $team->team_primary_color; ?>"><?php echo $team->team_name ?></h1>
      					</div>
      
    7. Then, to show the team stats, insert the following lines:
      				<div id="team-stats" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
      					<h4><?php echo get_option( 'sports-bench-season-year' ) . ' ' . __( 'Stats', 'sports-bench' ); ?></h4>
      					<?php echo sports_bench_get_players_stats_table( sports_bench_get_players_stats( $team->team_id,  '"' . get_option( 'sports-bench-season-year' ) . '"' ) ); ?>
      				</div>
      
    8. Finally, to show the team’s roster, insert the following lines:
      				<div id="team-roster" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
      					<h4><?php _e( 'Roster', 'sports-bench' ); ?></h4>
      					<?php echo sports_bench_show_roster( $team->team_id ); ?>
      				</div>
      
    9. All right, that’s it for the main body of the page template. Now let’s finish off the template with the sidebar.

    Adding in the Sidebar

    This part will be a bit challenging, but again, if you follow the directions here, you’ll do just fine. If you want, you can use this code to sort of give you a guide through what it should look like.

    1. First we need to add a conditional to see if this is a page for a single team or not. So where the get_sidebar function is in your page template, place the lines of code below. If the function is wrapped in a div with a class of “widgets” or “sidebar”, place this code inside that div and disregard that same div in the following code.
      				<?php if ( isset( $team ) ) { ?>
      					<div id="sidebar1" class="sidebar">
      					</div>
      				<?php } else { ?>
      					<?php get_sidebar(); ?>
      				<?php } ?>
      

      It should go without saying that this will replace the original get_sidebar function in your template file.

    2. The remainder of the code will go inside the <?php if ( isset( $team ) ) { ?> section. Now, to show the schedule, place the following lines of code:
      				<aside id="schedule-info" class="widget" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
                      	<h4 class="widgettitle"><?php echo $team->team_name . ' ' . get_theme_mod( 'sports-bench-season-year' ) . ' ' . __( 'Schedule', 'sports-bench' ); ?></h4>
      					<?php echo sports_bench_show_team_schedule( $team->team_id ); ?>
                      </aside>
      
    3. To show the division or conference standings for the team, place the following lines of code:
      				<aside id="standings" class="widget" style="border-top: 2px solid <?php echo $team->team_secondary_color; ?>">
                          <?php global $wpdb;
                          $table = $wpdb->prefix . 'sb_divisions';
                          $querystr = "SELECT * FROM $table WHERE division_id = $team->team_division;";
                          $division = $wpdb->get_results($querystr);
                          $division_title = $division[ 0 ]->division_name . ' ' . __( 'Standings', 'sports-bench' ); ?>
                          <h4 class="widgettitle"><?php echo $division_title; ?></h4>
      					<?php echo sports_bench_team_division_standings( $team->team_division ); ?>
                      </aside>
      
    4. Finally, to show some more team information, add the following lines of code:
      				<aside id="team-info" class="widget clearfix" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
                          <h4 class="widgettitle"><?php _e( 'Team Info', 'sports-bench' ); ?></h4>
      					<?php echo sports_bench_show_team_info( $team->team_id ); ?>
                      </aside>
      

    Setting up the Team Template

    Okay, we’re almost done with the team page template, but now we need to add the actual page to the site.

    1. Create a new page and name it “Teams”.
    2. On the right-hand side, look for “Page Attributes”. Then select “Team”. Then hit publish.
    3. Next, go to Sports Bench Settings. Find the Team Page setting and then select this newly created page. Hit “Publish”.
    4. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
    5. Now navigate to your newly created team page and enjoy your hard work. You deserve it.

    That’s it! You’ve now completed creating a template for the teams in your league. It’s now a one-stop-shop for all team information. Confidence in your coding skills continuing to go up? Great! We’re about to take another step up in difficulty. But you’ll do fine.

  • Setting Up the Players Page Template

    Okay, so you’re almost complete getting everything going with your website and Sports Bench. But now we’re getting into the challenging part. However, there’s good news. With Sports Bench 1.3, you can add a player page template with a simple shortcode. Or you can learn and dig into the code and do it that way. Both ways will be shown here.

    Using the Player Page Shortcode

    1. First, create a new page. Then in the new page create a new shortcode. To do this, click the “SB” button in the TinyMCE editor at the top.
    2. In the window that now appears, select “Player Page” and then insert. Then hit “Publish”.
    3. Next, navigate to the Sports Bench Options page. It should be in the menu on the left in the admin.
    4. In the options page, select your new page for the Player Page option and then hit save.
    5. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
    6. And that’s it. Your player page is ready to go. And you didn’t even need to write a single line of code.

    Using a Player Page Template

    Introducing the Player Class

    Before we get going too far, let’s introduce a simple concept that you’ll use here and elsewhere if you want to customize your site even further. Sports Bench comes with three classes: Sports_Bench_Game, Sports_Bench_Player and Sports_Bench_Teams. Here we’ll just look at the player class. If you’re not too familiar with PHP or object-oriented programming, just know that adding the following to your code essentially calls the player from the database and populates it attributes without you having to write more code.

    <?php $player = new Sports_Bench_Player( (int){{player_id}} ); ?>

    Note that the player id will need to be an actual integer number. From here, you can get the player’s first name, last name and so much more. In fact, here’s a list of the available attributes you can call, plus one function we’ll use to set up this page.

    • $player->player_id
    • $player->player_first_name
    • $player->player_last_name
    • $player->player_photo
    • $player->player_position
    • $player->player_home_city
    • $player->player_home_state
    • $player->player_date_of_birth
    • $player->team_id
    • $player->player_weight
    • $player->player_height
    • $player->player_slug
    • $player->get_player_photo()

    So now that we’ve gone over something we’ll be using here, let’s start building the player page, shall we? If you want to learn more about the Player class and the other classes, please visit the codex page on the Sports Bench website.

    Building the Player Page

    So creating the player page involves creating a new page template. It’s a simple concept in WordPress, but if you’re unfamiliar with it, you can read this, this and this tutorial on how to do that. Otherwise, let’s get started.

    1. So first off, create a new page template in your theme’s main directory. Name it page-player.php
    2. Next, copy the contents of your theme’s page.php file and paste it into this new page template file.
    3. At the top underneath the opening php tag, paste the following: Template Name: Player
    4. Look at the body of your new page template’s contents. First find the Loop. If you’re unfamiliar with the loop, look for a section that looks like if ( have_posts() ) : while( have_posts() ) : the_post();. Inside of that, look for a <main> or <article> tag and delete everything inside of that.
    5. Replace the now-deleted code with the following:
      				<?php if ( class_exists( 'Sports_Bench_Player' ) ) { ?>
      					<?php if ( get_query_var( 'player_slug' ) ) { ?>
      					<?php } else { ?>
      					<?php } ?>
      				<?php } ?>
      
    6. From here, let’s get the simple part out of the way first. Inside the else statement, place the following line of code: <?php echo sports_bench_show_team_player_select(); ?> This will show a dropdown of teams to pick players from if there’s no player slug in the url. For a live look at what this does, click here.
    7. With that out of the way, let’s get to the fun part. Inside of the if ( get_query_var( 'player_slug' ) ) statement, first add the following:
      				<? if ( get_query_var( 'player_slug' ) ) {
      				$player = new Sports_Bench_Player(get_query_var('player_slug'));
      				$team = new Sports_Bench_Team((int)$player->team_id);
      				} ?>
      
      				<div class="player-info">
      					<?php echo sports_bench_show_player_info( $player->player_id ); ?>
      				</div>
      

      This will display the player’s photo and his/her name, height, weight, position, age and hometown if those are entered. You might have to do some styling to get the section to match your theme’s style.

    8. Finally, below the code you just pasted, place the following lines of code:
      				<div id="player-stats" class="widget" style="border-top: 2px solid <?php echo $team->team_primary_color; ?>">
      					<h4 class="widgettitle"><?php echo __( 'Career Stats', 'sports-bench' ); ?></h4>
      					<?php echo sports_bench_get_season_stats( $player ); ?>
      				</div>
      

      This will show a table of the player’s career stats by season. And if you click on a season, you’ll see the game-by-game stats. And the best part, that functionality requires no code from you.

    9. Now, go create a new page. Title it “Players”. Then go down on the right side of the editor to the “Page Attributes” section and select “Player” from the page template dropdown.
    10. Next, go to the Sports Bench Settings page inside the Customizer. Then find the Player Page option and select the page you’ve just created. Then hit publish.
    11. After that, go to the permalinks page. This can be found under the Settings section in the admin. Don’t tough your permalinks, but hit save at the bottom. This will reset the necessary redirects to make the page work.
    12. Then navigate to that page. You should now see the dropdown. Pick a team and then click on a player. And now you should see his/her player page.

    And that’s it! You’ve survived some intermediate coding and you’ve created a really cool player page that you can show off. You’re harnessing the power of Sports Bench. Confidence going up? Good. We’re going to take another step higher in the next section. But for now, admire your work.

  • Adding Game Recaps and Previews

    We are so close to the finish line. You’re doing great, but now we’ve reached our toughest challenge yet. However, with this as your guide, you’ll be done with it in no time. This section deals with post templates. Introduced in WordPress 4.7, post templates work the same as page template, but obviously with post types and an extra line of code. This is also why WordPress 4.7 is required for this plugin. This section will cover creating game preview and game recap post templates. We’ll start easy first with game previews.

    Creating the Game Preview Template

    There are two ways you can create game previews. The easiest is to use the “Game” shortcode. To do this, add a new post and then hit the “SB” at the top of the editor. Then select game and then the game you want to show. And that’s all you need. If you want to create a custom post template for previews, use the directions below.

    1. Like the player and team templates, create a new php file and name it page-game-preview.php. But now, copy the contents of your theme’s single.php file. And we’re also going to leave the loop untouched. Our focus is on the sidebar.
    2. Again, like the player team templates, add the following lines of code to right after the opening php tag. Note the extra line which helps WordPress realize that this is intended for posts and not pages.
      				Template Name: Game Preview
      				Template Post Type: post
      
    3. Now that that’s taken care of, let’s turn our attention to the sidebar. Again, locate where the get_sidebar function. If it’s wrapped in a div with a class of “sidebar” or “widgets” or something of the like, you have nothing to worry about. The lines of code we’ll write later on will go right before this function. Otherwise, locate your theme’s sidebar.php file. Copy the lines of code that control the primary sidebar and replace the get_sidebar function in the template with the copied code. It might look something like this:
      				<div id="sidebar1" class="sidebar>
      					<?php if ( is_active_sidebar( 'sidebar1' ) ) : ?>
      						<?php dynamic_sidebar( 'sidebar1' ); ?>
      					<?php endif; ?>
      				</div>
      

      Note: Your sidebar.php file probably won’t look exactly like this. This is more a guide. It should, however, at least look something like it if it’s up to WordPress standards.

    4. Now, right before either the code you just pasted or the get_sidebar functions, add in the following lines of code to add a game preview “widget”. This will show the teams’ records, names and logos as well as the date, time and location of the game. If the game is final, the score will show. And if the game has a recap, a link to the recap will show as well.
      				<?php echo sports_bench_show_game_preview_info(); ?>
      
    5. So that’s all of the coding we have to do for the preview template. Now let’s add a preview. To start, add a new page. Then type a preview into the main post editor.
    6. Once you are done, go the “Post Attributes” section on the right-hand side. Select “Game Preview” from the post template dropdown. next, find the custom fields for Sports Bench. It’ll be below the main editor somewhere, depending on what plugins you have installed. There, select “Preview” and then select which game this is a preview for.
    7. Now hit “Publish” and then hit “View Post”. And that’s it. You’ve created a really cool game preview post template that adds necessary info with minimal effort from you in the future. Congrats! Now let’s move on to game recaps.

    Creating the Game Recap Template

    There are two ways you can create game recap areas. The easiest is to use the game recap shortcode. To do this, add a new post and then hit the “SB” at the top of the editor. Then select “Game Recap” and then the game you want to show. And that’s all you need. If you want to create a custom post template for recaps, use the directions below.

    1. Like the game preview template, create a new php file and name it page-game-recap.php and copy the contents of your theme’s single.php file into the new template.
    2. Like the game preview template, add the following lines of code right after the opening php tag:
      				Template Name: Game Recap
      				Template Post Type: post
      
    3. Again, let’s turn our attention to where the get_sidebar function is located. If it’s inside a div with the class “sidebar” or “widgets” or the like, simply delete the function since we’re overriding the default sidebar here. Otherwise, go to the sidebar.php file and copy the div that contains the actual sidebar. You don’t need any inside that div, just the outer shell. Then paste that over the get_sidebar function in the recap template.
    4. Now, inside the sidebar container that was either already there or just pasted, place the following line of code:
      				<?php echo sports_bench_show_game_stats_info(); ?>
      
    5. So that’s all the coding you have to do. But let’s add a recap just to test it out. To start go add add a new post and put some text into the main text editor.
    6. Next, scroll down on the right-hand side and find the “Post Attributes” section. Select “Game Recap” as the post template.
    7. Then find the Sports Bench custom fields. This will be somewhere below the main post editor depending on what plugins you have on your site. There select “Recap” and then select the game the recap is for.
    8. Finally, hit publish and then view the post. Congrats! You’ve now created a recap template that will show off all sorts of information from the scoreline to the team stats to the individual stats. It looks awesome.

    And that’s all the code you need to get started. The best part is now, when you create a preview or a recap for a game, the link to that post will automatically show up on the team page and where the game is located on the scoreboard. It adds that extra functionality that takes your site to the next level.

  • Customizations

    It is possible to make customization, both in the code in style. The recommended way is to make your own customization plugin so that your changes aren’t overwritten by an update. Here’s how to do that:

    1. Find the plugins directory on your web hosting and create a new directory inside of it. Call the new file ‘sports-bench-customizations’.
    2. Inside of the new directory, create a php file name sports-bench-customizations.php.
    3. Inside of the file, paste the following at the top:
      • <?php
                           /*
                           Plugin Name: Sports Bench Customizations
                           Plugin URI:
                           Description: A place to put customizations for the Sports Bench plugin
                           Version:     1.0
                           Author:
                           Author URI:
                           License:     GPL3
                           License URI: https://www.gnu.org/licenses/gpl-3.0.html
                           */
                           ?>
    4. Inside of this directory, you can include JavaScript, CSS, and other items and then call them from the php file. You can also create custom functions as well.
    5. Make sure to activate the plugin as you would any other plugin.
  • Setting Up the Homepage

    Setting up the homepage to run as it should is a fairly quick process.

    1. Navigate to the “Customize” page in the admin. Then click “Theme Settings”.
    2. Determine if you want to hide sticky posts in the slider and home page.
    3. Determine the category to show in the slider. The suggested practice is to create a “top story” category and use that.
    4. Determine the categories to show below the slider. Each category will show up as a tab, as well as a tab with all of the latest posts.

    That’s it. The theme is all set up to run as you like.

  • Creating a Longform Post

    Creating a longform story is simple with WordPress 4.7 and the Sports Bench theme; however, for this to work, you must be using WordPress 4.7.

    • Create a post like you normally would. Typically, longform stories are over 1,000 words long, but any length will do for you.
    • Before hitting publish, scroll down to the “Post Attributes” box in the right sidebar of the page and select “Longform”.
    • Make sure you upload a large featured image as it will display across the top of the page.

See Sports Bench in Action

Want to see Sports Bench in action before deciding whether to purchase it or not? Click the link below to see the demo, where you can see all of the features the plugin and theme combo has to offer.

View Demo

Pricing Information

Plugin Only

  • Ability to integrate the plugin into a theme you’re already using.
  • Complete codex to customize usage of the plugin with the theme you already use.
  • Ability to add more functions and other customizations to the plugin.

$25.00

Plugin and Theme

  • Full integration between the theme and plugin with no extra work needed.
  • Comes with page templates for standings, scoreboards, stats, teams and players already created.
  • Complete codex to customize the theme and plugin to your liking.
  • Ability to add more functions and other customizations to the plugin.

$35.00

Theme Only

  • Nice, clean and modern WordPress theme.
  • Full-width featured post slider on the home page.
  • Tabbed post home page.
  • Social media options.

$10.00

Purchase

Other Documentation

Changelog

1.7.2 – December 28, 2018

Plugin
  • Added a Polish translation.
  • Fixed issue with rivalry block not showing the series score or recent games.
  • Added check with has_blocks when loading scripts and styles for blocks.
  • Fixed issue with player, game and game recap blocks’ select dropdowns not working correctly.
Theme
  • Update to Foundation 6.5.1.

1.7.1 – December 9, 2018

Plugin
  • Tested to work with WordPress 5.0 and Gutenberg.

1.7 – September 8, 2018

Plugin
  • Added team stats for team page.
  • Added team and season filters for stat search.
Theme
  • Added styling for new Gutenberg block elements.
  • Added Sports Bench styles to the Gutenberg editor.

1.6 – July 19, 2017

Plugin
  • Added the ability to export league data as a CSV.
  • Added the ability to search for player stats on the front and back end of the website.
  • Added the ability to list basketball referees for games.
  • Fixed errors in Gutenberg blocks.
  • Fixed issue with shortcodes not having the correct amount of arguments for certain filters.
Theme
  • Updated the theme to make it run the best it can.

1.5.2 – April 4, 2018

Plugin
  • Fixed error when trying to load Gutenberg blocks without the Gutenberg plugin.

1.5.1 – April 3, 2018

Plugin
  • Added Gutenberg blocks for brackets, games, game recaps, list division, players, player pages, stats, scoreboard, standings, team, team pages and team schedules.

1.5 – March 7, 2018

Plugin
  • Redesigned the admin elements in order to make it look up to today’s web design standards.
  • Removed default font styling to make the plugin match the current theme better.
  • Added option to use the Josefin Sans font in the front-facing elements of the plugin.
  • Added the ability to create a stylesheet in your theme that will override any Sports Bench styling.
  • Made sure abbreviation guides were added if wanted.
  • Other smaller fixes to make Sports Bench the best it can be.
Theme
  • Redesigned theme to make it match the current web design standards.
  • Added an option to have a slider or tiled posts section at the top of the homepage.
  • Added color options for a red, orange, yellow, green, blue, purple or default theme.
  • Updated to match the Sports Bench plugin.
  • Other small changes to make Sports Bench the best it can be.

1.4 – December 6, 2017

Plugin
  • Added support for rugby and volleyball.
  • Added links to opposing teams from the team schedule.
  • Hid game time if it’s set to midnight. This helps for games with a TBA or TBD game time.
  • Added a shortcode to list teams by division or conference.
  • Added support for neutral site games.
  • Added the ability to include a Google Map with game previews.
  • Added an options endpoint for Sports Bench options.
  • Added the ability to display a link to a page in the scoreboard, standings and stats widgets.
  • Changed row class from “row” to “sports-bench-row” to eliminate conflicts with Bootstrap.
  • Added a team schedule widget.
  • Added the ability to add, create, update and delete items for brackets, divisions, games, game events, game stats, players, playoff series and teams with the WP REST API.
  • Other fixes to make Sports Bench better.
  • Tested with WordPress 4.9.
Theme
  • Added an option to show the homepage slider full-width or at a max-width of 1200px.
  • Tested with WordPress 4.9.

1.3 – September 6, 2017

Plugin
  • Changed some AJAX functions to use the WP REST API.
  • Added rivalry, team page, player page and game recap shortcodes.
  • Added Sports Bench Options page and removed the options from the Customizer.
  • Added a CSV import function.
Theme
  • Changed the sidebar on the player page template to show team information.

1.2.3 – August 3, 2017

Plugin
  • Fixed issue with date picker not showing up on add/edit player page.

1.2.2 – August 3, 2017

Plugin
  • Fixed issue with players not saving.
  • Fixed issue with games not saving because of difference in initial sport in ‘Add Game’ and the database.

1.2.1 – June 21, 2017

Plugin
  • Added better functionality for WP REST API routes, including the ability to group stats by players.
  • Fixed strip slashes issue with player’s height.

1.2 – June 7, 2017

Plugin
  • Fixed error that shows up in the standings widget and standings dashboard widget when there are no teams in the database.
  • Fixed issue with keepers not showing up in the right spot in the game recaps.
  • Changed the style of the teams adn players admin listing and edit pages to match the style of the games admin pages.
  • Added the ability to create playoff brackets.
  • Added an active/inactive option for teams.
  • Made “Free Agent” a team choice for players.
  • Redesigned the games dashboard widget to match the style of the games listing page.
  • Added shortcodes to show the scoreboard, standings or stats.
  • Fixed other minor issues with the plugin.
  • Tested to work with WordPress 4.8.
Theme
  • Fixed issue slider arrows not showing up and centered them vertically.
  • Fixed issue with header covering up top part of post title in the slider.
  • Centered the post title, details and excerpt vertically inside the slider.
  • Tested to work with WordPress 4.8.

1.1- January 7, 2017

Plugin
  • Added custom routes to the WP REST API for all tables.
  • Added standings and games dashboard widgets.
  • Changed the style of the game list page and add/edit game page to make adding game stats much easier.
Theme
  • Vertically centered the post title and information on the longform template.

1.0

  • Initial release to the world.

Licenses

GNU General Public License

http://www.gnu.org/licenses/gpl.html

Photo License

Except where otherwise noted, all photos in the screenshot are also licensed under the GNU General Public License. Copyright 2015 Jacob Martella

Social Media Icons License

All of the social media icons are licensed under the GNU General Public License (http://www.gnu.org/licenses/gpl.html).

Scripts License

All of the scripts used in this theme are licensed under the GNU General Public License (http://www.gnu.org/licenses/gpl.html).

Fonts License

PlayfairDisplay-Regular.ttf: Copyright (c) 2010-2012 by Claus Eggers Sørensen (es@forthehearts.net), with Reserved Font Name ‘Playfair’ PlayfairDisplay-Italic.ttf: Copyright (c) 2010-2012 by Claus Eggers Sørensen (es@forthehearts.net), with Reserved Font Name ‘Playfair’ PlayfairDisplay-Bold.ttf: Copyright (c) 2010-2012 by Claus Eggers Sørensen (es@forthehearts.net), with Reserved Font Name ‘Playfair’ Roboto-Light.ttf: Copyright 2011 Google Inc. All Rights Reserved. Roboto-LightItalic.ttf: Copyright 2011 Google Inc. All Rights Reserved. Roboto-Regular.ttf: Copyright 2011 Google Inc. All Rights Reserved. Roboto-Italic.ttf: Copyright 2011 Google Inc. All Rights Reserved. Roboto-Bold.ttf: Copyright 2011 Google Inc. All Rights Reserved. Oswald-Regular.ttf: Copyright (c) 2011-2012, Vernon Adams (vern@newtypography.co.uk), with Reserved Font Names ‘Oswald’ Oswald-Bold.ttf: Copyright (c) 2011-2012, Vernon Adams (vern@newtypography.co.uk), with Reserved Font Names ‘Oswald’

Foundation License

Foundation is licensed under the MIT license. http://www.opensource.org/licenses/mit-license.php

JointsWP License

JointsWP is licensed under the GNU General Public License. http://www.gnu.org/licenses/gpl.html

Get In Contact

If you have an issue with the item, a feature you wish to see in a later release or want me to customize your version of the item, use the conact form below to get in touch with me. Please note that customizations will cost extra depending on what you wish to customize.

Sports Bench Blog Posts

Series and the REST API

The WP REST API rolled into WordPress core in 2017. And Sports Bench extends it further. We continue the SB REST API tutorial series with a look at playoff series.

Brackets and the REST API

The WP REST API rolled into WordPress core in 2017. And Sports Bench extends it further. We continue the SB REST API tutorial series with a look at brackets.

Other WordPress Plugins & Themes