diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php index 461a42608..9911bb272 100644 --- a/wp-includes/template-loader.php +++ b/wp-includes/template-loader.php @@ -35,8 +35,8 @@ if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) : elseif ( is_archive() && $template = get_archive_template() ) : elseif ( is_comments_popup() && $template = get_comments_popup_template() ) : elseif ( is_paged() && $template = get_paged_template() ) : - elseif ( file_exists( TEMPLATEPATH . '/index.php' ) ) : - $template = TEMPLATEPATH . '/index.php'; + else : + $template = get_index_template(); endif; if ( $template = apply_filters( 'template_include', $template ) ) include( $template ); diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 3e3ca319f..29e677b56 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -685,6 +685,17 @@ function get_query_template($type) { return apply_filters("{$type}_template", locate_template(array("{$type}.php"))); } +/** + * Retrieve path of index template in current or parent template. + * + * @since 3.0.0 + * + * @return string + */ +function get_index_template() { + return get_query_template('index'); +} + /** * Retrieve path of 404 template in current or parent template. *