Load sportspress.php as fallback
This commit is contained in:
@@ -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 ):
|
||||
|
||||
Reference in New Issue
Block a user