diff --git a/wp-content/themes/twentyten/archive.php b/wp-content/themes/twentyten/archive.php index d8c1e56a0..cda1c64e8 100644 --- a/wp-content/themes/twentyten/archive.php +++ b/wp-content/themes/twentyten/archive.php @@ -17,7 +17,7 @@ - + diff --git a/wp-content/themes/twentyten/author.php b/wp-content/themes/twentyten/author.php index 6c27b3b91..e1ccd0c7a 100644 --- a/wp-content/themes/twentyten/author.php +++ b/wp-content/themes/twentyten/author.php @@ -21,7 +21,7 @@ - + diff --git a/wp-content/themes/twentyten/category.php b/wp-content/themes/twentyten/category.php index 4614cd156..8b72a1ac4 100644 --- a/wp-content/themes/twentyten/category.php +++ b/wp-content/themes/twentyten/category.php @@ -10,7 +10,7 @@ - + diff --git a/wp-content/themes/twentyten/index.php b/wp-content/themes/twentyten/index.php index eb6b9f09a..e12aa8050 100644 --- a/wp-content/themes/twentyten/index.php +++ b/wp-content/themes/twentyten/index.php @@ -4,7 +4,7 @@

diff --git a/wp-content/themes/twentyten/search.php b/wp-content/themes/twentyten/search.php index 7fa68a3f0..6e83f1edd 100644 --- a/wp-content/themes/twentyten/search.php +++ b/wp-content/themes/twentyten/search.php @@ -5,7 +5,7 @@

- +

diff --git a/wp-content/themes/twentyten/tag.php b/wp-content/themes/twentyten/tag.php index e768230c4..081379ec0 100644 --- a/wp-content/themes/twentyten/tag.php +++ b/wp-content/themes/twentyten/tag.php @@ -9,7 +9,7 @@ - +
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 8f6f70b89..3180f9244 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -93,6 +93,35 @@ function get_sidebar( $name = null ) { load_template( get_theme_root() . '/default/sidebar.php'); } +/** + * Load a generic template. + * + * Includes the named template for a theme or if a name is specified then a + * specialised template will be included. If the theme contains no {slug}.php file + * then no template will be included. + * + * For the parameter, if the file is called "{slug}-special.php" then specify + * "special". + * + * @uses locate_template() + * @since 3.0.0 + * @uses do_action() Calls 'get_generic_template_{$slug}' action. + * + * @param string $slug The slug name for the generic template. + * @param string $name The name of the specialised template. + */ +function get_generic_template( $slug, $name = null ) { + do_action( "get_generic_template_{$slug}", $name ); + + $templates = array(); + if ( isset($name) ) + $templates[] = "{$slug}-{$name}.php"; + + $templates[] = "{$slug}.php"; + + locate_template($templates, true); +} + /** * Display search form. *