Menu Close Menu
Menu
  • Themes
  • Extensions
  • Showcase
  • Support
    • Documentation
    • Open Support Ticket
    • Terms & Conditions
  • Blog
  • Account
    • Number of items in cart: 0

      • Your cart is empty.
      • Subtotal: $0.00
      • Estimated Tax: $0.00
      • Total: $0.00
      • Checkout

Third Party Theme Compatibility

Third Party Theme Compatibility

For the most part, WP Club Manager templates will integrate nicely with most WordPress themes. Where you may run into problems is when the default WP Club Manager content wrappers do not match your chosen themes. This will manifest itself by breaking your layout on WP Club Manager pages and shifting your sidebars into incorrect positions.

This problem can potentially affect the  single player, staff, match and club pages because WP Club Manager uses templates of its own to display these pages and its impossible for WP Club Manager to know exactly what markup your theme uses.

There are two ways to resolve this:

  • Using hooks (for advanced users/developers)
  • Using our catch-all wpclubmanager_content() function inside your theme

Using wpclubmanager_content()

This solution allows you to create a new template page within your theme that is used for all WP Club Manager post type displays. While an easy catch-all solution, it does have a drawback in that this template is used for all WPCM post types (players, staff, matches and clubs). Developers are encouraged to use the hooks instead.

To set up this template page:

Duplicate page.php

Duplicate your theme’s page.php file, and name it wpclubmanager.php.This file should be found like this: wp-content/themes/YOURTHEME/wpclubmanager.php.

Edit your page (wpclubmanager.php)

Open up your newly created wpclubmanager.php in a text editor, or the editor of your choice.

Replace the loop

Next you need to find the loop (see The_Loop). The loop usually starts with a:

<?php if ( have_posts() ) :

and usually ends with:

<?php endif; ?>

This varies between themes. Once you have found it, delete it. In its place, put:

<?php wpclubmanager_content(); ?>

This will make it use WP Club Manager loop instead. Save the file. You’re done.

Using Hooks

Using hooks to alter the layout of WP Club Manager gives you the flexibility to style your theme in many different ways. This is similar to the method we use when creating our themes. It’s also the method we use to integrate nicely with the default WordPress themes.

By inserting a few lines in your theme’s functions.php file.

First unhook the WP Club Manager wrappers;

remove_action( 'wpclubmanager_before_main_content', 'wpclubmanager_output_content_wrapper', 10);
remove_action( 'wpclubmanager_after_main_content', 'wpclubmanager_output_content_wrapper_end', 10);

Then hook in your own functions to display the wrappers your theme requires;

add_action('wpclubmanager_before_main_content', 'my_theme_wrapper_start', 10);
add_action('wpclubmanager_after_main_content', 'my_theme_wrapper_end', 10); 
function my_theme_wrapper_start() {
	echo '<section id="main">';
} 
function my_theme_wrapper_end() {
	echo '</section>';
}

Make sure that the markup matches that of your theme. If you’re unsure of which classes or ID’s to use take a look at your theme’s page.php for a guide.

Declare WP Club Manager Support

Once you’re happy that your theme fully supports WP Club Manager, you should declare it in the code to hide the “Your theme does not declare WP Club Manager support” message. To do so you should add the following to your theme support function;

add_theme_support( 'wpclubmanager' );

Themes by Clubpress

Save time creating your own templates or finding a suitable theme and get one of our purpose-built WordPress themes. Our themes are built specifically for WP Club Manager and will offer extra functionality and features to make your WordPress club website more comprehensive than ever before.

4th October 2020

Post navigation

Previous

Overriding Templates

Next

Introduction to Hooks: Actions & Filters

Docs Categories

  • Clubs (4)
  • Getting Started (4)
  • League Tables & Rosters (3)
  • Matches (6)
  • Players & Staff (9)
  • Plugin Settings (11)
  • Shortcodes (8)
  • Snippets (4)
  • Theming & Extending (3)
  • Widgets (6)

Popular Articles

  • Third Party Theme Compatibility
  • Match List Shortcode
  • Managing Clubs
  • League Table Shortcode
  • Quick Start Guide
  • Extensions
  • Themes
  • Showcase
  • Terms
  • Documentation
  • Support
  • Support Policy
  • Blog
© 2014-20 WP Club Manager | Manage your sports club website