How to Integrate SportsPress into Any WordPress Theme

SportsPress can turn WordPress into a sleek, bustling hub for your sports tournament or league website. You can use any theme you want, but if you integrate SportsPress with your theme, you can control every aspect of how your website looks and works.

With SportsPress you can track, display, and automatically calculate scores, display event maps, player profiles, and a ton more.

A few coding adjustments to any WordPress theme and you can completely customize your website’s design. You can style it to your exacting specifications and display eye-catching scoreboards and player profiles. They’ll also perfectly integrate with SportsPress.

You can even customize how certain features work by optionally using the WordPress hooks included in SportsPress.

Today, I’ll show you how to integrate SportsPress into any WordPress theme with code. That way, you can further customize the code for your sports website’s design and functionality.

Hook, Line and Sinker

WordPress has what are called hooks included in its code. They let you link the WordPress software in with your plugin or theme so you can completely customize how WordPress works for your website.

It’s easier to remember what hooks are in relation to WordPress when you think about fishing with a hook on the end of fishing line. Once you cast out the fishing line into the water, the hook can catch a fish.

You can think of the water as your plugin or theme. The fish is a certain functionality you want to achieve. By using a WordPress hook, you can cast out into the plugin or theme you’re working on to lock in the capabilities you want to achieve.

There are also two types of hooks:

  • Actions – Aptly named, these kinds of hooks let you create an action during any point of loading WordPress page. For example, you could use an action to send a post to social media after it’s published or to display text on the page before other content.
  • Filters – These hooks are different and are used when you need to change data before it’s sent to the database or loaded on a page. For example, if you want to change the text on a page before it has fully loaded.

For details, check out The Beginner’s Guide to WordPress Actions and Filters and Hooks: Actions and Filters in the WordPress Codex.

SportsPress uses WordPress actions and filters so you can hook into them to further customize your theme. For details on this, check out the Theme Integration Guide.

Create a Child Theme and Backup

Unless you’re creating or working on your own theme, it’s a good idea to create a child theme since you’re customizing it. Doing so prevents any future theme updates from permanently erasing the changes you’re about to make to integrate SportsPress.

For details, check out the WordPress Codex’s Child Themes page and How to Create a WordPress Child Theme.

It’s also important to backup your entire site after you have created your child theme. That way, if something goes wrong, you can quickly restore it.

For details, check out WordPress Backups in the WordPress Codex.

Creating Your Page Template

By default after you install the SportsPress plugin, your theme’s main page template is used to display features such as scoreboards. But, you can create your own page templates to have total control over how SportsPress features are displayed and styled.

You can either create one page template or multiple ones depending on your needs. The advantage of creating multiple page templates is you can have more control over how each SportsPress features is displayed.

For example, if one particular table isn’t looking exactly like you want it to, but the rest looks great, then you can create multiple templates to style the one table.

You can create one template for each post type that SportsPress uses.

Making a Standard Template

To create one standard template for displaying all the tables and sports data, start by accessing your site on its server through FTP or SSH.

For details on FTP, check out Using FileZilla in the WordPress Codex and How to Use FTP Properly with WordPress.

For details on SSH, check out A Quick Guide to the Terminal and Command Line Prompt for WordPress and SSH Tutorial: How to Use SSH.

Find the root of your site, then go to /wp-content/themes/your-theme/ where your-theme is the folder with your actual theme’s name.

Then, locate the page.php file within your theme’s folder. Make a copy of it in the same folder, then rename that copy to <codesportspress.php.

In FTP and FileZilla, you can right click on the page.php file, click the View/Edit option, then open the file in a code editor.

You don’t need to touch the code yet, but you do need to save the file under a new name: sportspress.php.

Once that’s done, the new file should be uploaded to your server with the original page.php file.

Stay in the loop

Enjoy this article? Get more content like this directly in your inbox.

Take your club to the next level

Already have a theme? SportsPress Pro adds advanced sports features to any WordPress site, and works perfectly together with any of our themes.