WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/30/2008 06:21:14 AM (13 years ago)
Author:
westi
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r8415 r8497  
    55function get_header() {
    66    do_action( 'get_header' );
    7     if ( file_exists( TEMPLATEPATH . '/header.php') )
     7    if ( file_exists( STYLESHEETPATH . '/header.php') )
     8        load_template( STYLESHEETPATH . '/header.php');
     9    elseif ( file_exists( TEMPLATEPATH . '/header.php') )
    810        load_template( TEMPLATEPATH . '/header.php');
    911    else
     
    1416function get_footer() {
    1517    do_action( 'get_footer' );
    16     if ( file_exists( TEMPLATEPATH . '/footer.php') )
     18    if ( file_exists( STYLESHEETPATH . '/footer.php') )
     19        load_template( STYLESHEETPATH . '/footer.php');
     20    elseif ( file_exists( TEMPLATEPATH . '/footer.php') )
    1721        load_template( TEMPLATEPATH . '/footer.php');
    1822    else
     
    2327function get_sidebar( $name = null ) {
    2428    do_action( 'get_sidebar' );
    25     if ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
     29    if ( isset($name) && file_exists( STYLESHEETPATH . "/sidebar-{$name}.php") )
     30        load_template( STYLESHEETPATH . "/sidebar-{$name}.php");
     31    elseif ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
    2632        load_template( TEMPLATEPATH . "/sidebar-{$name}.php");
     33    elseif ( file_exists( STYLESHEETPATH . '/sidebar.php') )
     34        load_template( STYLESHEETPATH . '/sidebar.php');
    2735    elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') )
    2836        load_template( TEMPLATEPATH . '/sidebar.php');
Note: See TracChangeset for help on using the changeset viewer.