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
|
* Templates are in the 'templates' folder. sportspress looks for theme
|
||||||
* overrides in /theme/sportspress/ by default
|
* overrides in /theme/sportspress/ by default
|
||||||
*
|
*
|
||||||
* For beginners, it also looks for a sportspress.php template first. If the user adds
|
* 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 for all
|
* this to the theme (containing a sportspress() inside) this will be used as a
|
||||||
* sportspress templates.
|
* fallback for all sportspress templates.
|
||||||
*
|
*
|
||||||
* @param mixed $template
|
* @param mixed $template
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function template_loader( $template ) {
|
public function template_loader( $template ) {
|
||||||
$find = array( 'sportspress.php' );
|
$find = array();
|
||||||
$file = '';
|
$file = '';
|
||||||
|
|
||||||
if ( is_single() ):
|
if ( is_single() ):
|
||||||
@@ -174,6 +174,8 @@ class SP_Template_Loader {
|
|||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
$find[] = 'sportspress.php';
|
||||||
|
|
||||||
if ( $file ):
|
if ( $file ):
|
||||||
$located = locate_template( $find );
|
$located = locate_template( $find );
|
||||||
if ( $located ):
|
if ( $located ):
|
||||||
|
|||||||
Reference in New Issue
Block a user