From 60397cc23e189afc7620bc78f207009873eede19 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 9 Dec 2014 21:17:36 +1100 Subject: [PATCH] Load sportspress.php as fallback --- includes/class-sp-template-loader.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/class-sp-template-loader.php b/includes/class-sp-template-loader.php index 94b586ef..b6fdbd2b 100644 --- a/includes/class-sp-template-loader.php +++ b/includes/class-sp-template-loader.php @@ -108,15 +108,15 @@ class SP_Template_Loader { * Templates are in the 'templates' folder. sportspress looks for theme * overrides in /theme/sportspress/ by default * - * For beginners, it also looks for a sportspress.php template first. If the user adds - * this to the theme (containing a sportspress() inside) this will be used for all - * sportspress templates. + * For beginners, it also looks for a sportspress.php template last. If the user adds + * this to the theme (containing a sportspress() inside) this will be used as a + * fallback for all sportspress templates. * * @param mixed $template * @return string */ public function template_loader( $template ) { - $find = array( 'sportspress.php' ); + $find = array(); $file = ''; if ( is_single() ): @@ -174,6 +174,8 @@ class SP_Template_Loader { endif; + $find[] = 'sportspress.php'; + if ( $file ): $located = locate_template( $find ); if ( $located ):