Skip to main content

Theme Integration

SportsPress integrates with most WordPress themes by adding content via the `the_content` filter. The plugin does not require custom page templates to function, but supports them for full layout control. Additional plugin areas can be extended via p…

Updated today

Theme Integration

SportsPress integrates with most WordPress themes by adding content via the the_content filter. The plugin does not require custom page templates to function, but supports them for full layout control. Additional plugin areas can be extended via predefined action and filter hooks.

Template Override Hierarchy

When SportsPress loads a template, it checks the following locations in order:

  1. {theme}/sportspress/single-{post-type}.php — post-type-specific template in the active theme

  2. {theme}/sportspress/sportspress.php — generic SportsPress template for all SP post types

  3. {theme}/sportspress/taxonomy-venue.php — venue archive template

  4. Plugin default templates in includes/sportspress/templates/

If a match is found in the theme, it is used instead of the plugin default. This allows theme authors to fully override any SportsPress template without modifying plugin files.

Creating Custom Page Templates

Generic Template

Create a single template that applies to all SportsPress post types by duplicating your theme's page.php and naming it sportspress.php:

wp-content/themes/YOURTHEME/sportspress.php

Post-Type-Specific Templates

For individual layouts per post type, create a sportspress/ folder in your theme's root directory, then add the relevant files:

File

Post Type

single-event.php

Event

single-calendar.php

Calendar

single-team.php

Team

single-table.php

League Table

single-player.php

Player

single-list.php

Player List

single-staff.php

Staff

single-directory.php

Staff Directory

single-sponsor.php

Sponsor

taxonomy-venue.php

Venue archive

Example path:

wp-content/themes/YOURTHEME/sportspress/single-team.php

Declaring Theme Support

Themes that are built for SportsPress should declare support to suppress the "Your theme does not declare SportsPress support" admin notice. Add the following to your theme's functions.php:

add_theme_support( 'sportspress' );

This declaration does not change plugin behavior — it only removes the notice shown to theme users.

Content Injection Priority

SportsPress injects its templates into post content at a default priority of 10. The priority can be adjusted per post type using filter hooks:

// Change the priority for team pages
add_filter( 'sportspress_team_content_priority', function( $priority ) {
    return 20;
});

The filter name pattern is sportspress_{post_type}_content_priority where {post_type} is one of: event, calendar, team, table, player, list, staff.

Theme Partnership

ThemeBoy offers a partnership program for developers who sell SportsPress-compatible themes, providing 30% commission per referral. Details at https://www.themeboy.com/partners/.

Pre-built SportsPress themes are also available at https://www.themeboy.com/themes/.

Did this answer your question?