Load sportspress.php as fallback

This commit is contained in:
Brian Miyaji
2014-12-09 21:17:36 +11:00
parent 3bce7b8595
commit 60397cc23e

View File

@@ -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 ):