Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 8489)
+++ wp-includes/theme.php	(working copy)
@@ -343,7 +343,9 @@
 function get_query_template($type) {
 	$template = '';
 	$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
-	if ( file_exists(TEMPLATEPATH . "/{$type}.php") )
+	if ( file_exists(STYLESHEETPATH . "/{$type}.php") )
+		$template = STYLESHEETPATH . "/{$type}.php";
+	elseif ( file_exists(TEMPLATEPATH . "/{$type}.php") )
 		$template = TEMPLATEPATH . "/{$type}.php";
 
 	return apply_filters("{$type}_template", $template);
@@ -363,8 +365,12 @@
 
 function get_category_template() {
 	$template = '';
-	if ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') )
+	if ( file_exists(STYLESHEETPATH . "/category-" . absint( get_query_var('cat') ) . '.php') )
+		$template = STYLESHEETPATH . "/category-" . absint( get_query_var('cat') ) . '.php';
+	elseif ( file_exists(TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php') )
 		$template = TEMPLATEPATH . "/category-" . absint( get_query_var('cat') ) . '.php';
+	elseif ( file_exists(STYLESHEETPATH . "/category.php") )
+		$template = STYLESHEETPATH . "/category.php";
 	elseif ( file_exists(TEMPLATEPATH . "/category.php") )
 		$template = TEMPLATEPATH . "/category.php";
 
@@ -373,8 +379,12 @@
 
 function get_tag_template() {
 	$template = '';
-	if ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') )
+	if ( file_exists(STYLESHEETPATH . "/tag-" . get_query_var('tag') . '.php') )
+		$template = STYLESHEETPATH . "/tag-" . get_query_var('tag') . '.php';
+	elseif ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') )
 		$template = TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php';
+	elseif ( file_exists(STYLESHEETPATH . "/tag.php") )
+		$template = STYLESHEETPATH . "/tag.php";
 	elseif ( file_exists(TEMPLATEPATH . "/tag.php") )
 		$template = TEMPLATEPATH . "/tag.php";
 
@@ -385,10 +395,16 @@
 	$template = '';
 	$taxonomy = get_query_var('taxonomy');
 	$term = get_query_var('term');
-	if ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") )
+	if ( $taxonomy && $term && file_exists(STYLESHEETPATH . "/taxonomy-$taxonomy-$term.php") )
+		$template = STYLESHEETPATH . "/taxonomy-$taxonomy-$term.php";
+	elseif ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") )
 		$template = TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php";
+	elseif ( $taxonomy && file_exists(STYLESHEETPATH . "/taxonomy-$taxonomy.php") )
+		$template = STYLESHEETPATH . "/taxonomy-$taxonomy.php";
 	elseif ( $taxonomy && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy.php") )
 		$template = TEMPLATEPATH . "/taxonomy-$taxonomy.php";
+	elseif ( file_exists(STYLESHEETPATH . "/taxonomy.php") )
+		$template = STYLESHEETPATH . "/taxonomy.php";
 	elseif ( file_exists(TEMPLATEPATH . "/taxonomy.php") )
 		$template = TEMPLATEPATH . "/taxonomy.php";
 
@@ -402,8 +418,12 @@
 function get_home_template() {
 	$template = '';
 
-	if ( file_exists(TEMPLATEPATH . "/home.php") )
+	if ( file_exists(STYLESHEETPATH . "/home.php") )
+		$template = STYLESHEETPATH . "/home.php";
+	elseif ( file_exists(TEMPLATEPATH . "/home.php") )
 		$template = TEMPLATEPATH . "/home.php";
+	elseif ( file_exists(STYLESHEETPATH . "/index.php") )
+		$template = STYLESHEETPATH . "/index.php";
 	elseif ( file_exists(TEMPLATEPATH . "/index.php") )
 		$template = TEMPLATEPATH . "/index.php";
 
@@ -419,8 +439,12 @@
 	if ( 'default' == $template )
 		$template = '';
 
-	if ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") )
+	if ( !empty($template) && !validate_file($template) && file_exists(STYLESHEETPATH . "/$template") )
+		$template = STYLESHEETPATH . "/$template";
+	elseif ( !empty($template) && !validate_file($template) && file_exists(TEMPLATEPATH . "/$template") )
 		$template = TEMPLATEPATH . "/$template";
+	elseif ( file_exists(STYLESHEETPATH . "/page.php") )
+		$template = STYLESHEETPATH . "/page.php";
 	elseif ( file_exists(TEMPLATEPATH . "/page.php") )
 		$template = TEMPLATEPATH . "/page.php";
 	else
@@ -455,7 +479,9 @@
 }
 
 function get_comments_popup_template() {
-	if ( file_exists( TEMPLATEPATH . '/comments-popup.php') )
+	if ( file_exists( STYLESHEETPATH . '/comments-popup.php') )
+		$template = STYLESHEETPATH . '/comments-popup.php';
+	elseif ( file_exists( TEMPLATEPATH . '/comments-popup.php') )
 		$template = TEMPLATEPATH . '/comments-popup.php';
 	else
 		$template = get_theme_root() . '/default/comments-popup.php';
Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 8489)
+++ wp-includes/comment-template.php	(working copy)
@@ -664,11 +664,14 @@
 	update_comment_cache($comments);
 
 	define('COMMENTS_TEMPLATE', true);
-	$include = apply_filters('comments_template', TEMPLATEPATH . $file );
+		
+	$include = apply_filters('comments_template', STYLESHEETPATH . $file );
 	if ( file_exists( $include ) )
 		require( $include );
+	elseif ( file_exists( TEMPLATEPATH . $file ) )
+		require( TEMPLATEPATH .  $file );
 	else
-		require( WP_CONTENT_DIR . '/themes/default/comments.php');
+		require( get_theme_root() . '/default/comments.php');
 }
 
 /**
Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 8489)
+++ wp-includes/general-template.php	(working copy)
@@ -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_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_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

