Look for template files in the stylesheet folder as well as the template folder for inheriting themes. Fixes #7086 props ionfish.

git-svn-id: https://develop.svn.wordpress.org/trunk@8497 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2008-07-30 06:21:14 +00:00
parent ba35a97bb5
commit 8b8928d5ac
3 changed files with 57 additions and 15 deletions
+11 -3
View File
@@ -4,7 +4,9 @@
function get_header() {
do_action( 'get_header' );
if ( file_exists( TEMPLATEPATH . '/header.php') )
if ( file_exists( STYLESHEETPATH . '/header.php') )
load_template( STYLESHEETPATH . '/header.php');
elseif ( file_exists( TEMPLATEPATH . '/header.php') )
load_template( TEMPLATEPATH . '/header.php');
else
load_template( WP_CONTENT_DIR . '/themes/default/header.php');
@@ -13,7 +15,9 @@ function get_header() {
function get_footer() {
do_action( 'get_footer' );
if ( file_exists( TEMPLATEPATH . '/footer.php') )
if ( file_exists( STYLESHEETPATH . '/footer.php') )
load_template( STYLESHEETPATH . '/footer.php');
elseif ( file_exists( TEMPLATEPATH . '/footer.php') )
load_template( TEMPLATEPATH . '/footer.php');
else
load_template( WP_CONTENT_DIR . '/themes/default/footer.php');
@@ -22,8 +26,12 @@ function get_footer() {
function get_sidebar( $name = null ) {
do_action( 'get_sidebar' );
if ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
if ( isset($name) && file_exists( STYLESHEETPATH . "/sidebar-{$name}.php") )
load_template( STYLESHEETPATH . "/sidebar-{$name}.php");
elseif ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
load_template( TEMPLATEPATH . "/sidebar-{$name}.php");
elseif ( file_exists( STYLESHEETPATH . '/sidebar.php') )
load_template( STYLESHEETPATH . '/sidebar.php');
elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') )
load_template( TEMPLATEPATH . '/sidebar.php');
else