From ab6ff7fee4d32d680b8043e5ddb5ff475b4f13cb Mon Sep 17 00:00:00 2001 From: rboren Date: Sun, 2 Jan 2005 02:47:45 +0000 Subject: [PATCH] Relocate default theme to themes/default. Remove special casing of default theme. Do not look directly in wp-content/ for default theme files. Simplify, simplify. git-svn-id: http://svn.automattic.com/wordpress/trunk@2032 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- index.php | 36 +--------- .../themes/default/comments-popup.php | 0 .../themes/default/comments.php | 0 .../themes/default/footer.php | 0 .../themes/default/header.php | 0 wp-content/themes/default/index.php | 36 ++++++++++ .../themes/default/sidebar.php | 0 .../themes/default/style.css | 15 ++-- wp-includes/functions.php | 71 ++++--------------- wp-includes/template-functions-general.php | 24 ++----- 10 files changed, 66 insertions(+), 116 deletions(-) rename wp-includes/wp-comments-popup.php => wp-content/themes/default/comments-popup.php (100%) rename wp-includes/wp-comments.php => wp-content/themes/default/comments.php (100%) rename wp-includes/wp-footer.php => wp-content/themes/default/footer.php (100%) rename wp-includes/wp-header.php => wp-content/themes/default/header.php (100%) create mode 100644 wp-content/themes/default/index.php rename wp-includes/wp-sidebar.php => wp-content/themes/default/sidebar.php (100%) rename wp-includes/wp-layout.css => wp-content/themes/default/style.css (92%) diff --git a/index.php b/index.php index a0ef54bdd7..41f8f8c0ba 100644 --- a/index.php +++ b/index.php @@ -1,38 +1,4 @@ - - - -',''); ?> - -
-

-
@
- -
- -
- - - - - -
- - - - -

- - - - - \ No newline at end of file +?> \ No newline at end of file diff --git a/wp-includes/wp-comments-popup.php b/wp-content/themes/default/comments-popup.php similarity index 100% rename from wp-includes/wp-comments-popup.php rename to wp-content/themes/default/comments-popup.php diff --git a/wp-includes/wp-comments.php b/wp-content/themes/default/comments.php similarity index 100% rename from wp-includes/wp-comments.php rename to wp-content/themes/default/comments.php diff --git a/wp-includes/wp-footer.php b/wp-content/themes/default/footer.php similarity index 100% rename from wp-includes/wp-footer.php rename to wp-content/themes/default/footer.php diff --git a/wp-includes/wp-header.php b/wp-content/themes/default/header.php similarity index 100% rename from wp-includes/wp-header.php rename to wp-content/themes/default/header.php diff --git a/wp-content/themes/default/index.php b/wp-content/themes/default/index.php new file mode 100644 index 0000000000..0d65b07c64 --- /dev/null +++ b/wp-content/themes/default/index.php @@ -0,0 +1,36 @@ + + + + +',''); ?> + +
+

+
@
+ +
+ +
+ + + + + +
+ + + + +

+ + + + + diff --git a/wp-includes/wp-sidebar.php b/wp-content/themes/default/sidebar.php similarity index 100% rename from wp-includes/wp-sidebar.php rename to wp-content/themes/default/sidebar.php diff --git a/wp-includes/wp-layout.css b/wp-content/themes/default/style.css similarity index 92% rename from wp-includes/wp-layout.css rename to wp-content/themes/default/style.css index f95cf77536..30ab0926a7 100644 --- a/wp-includes/wp-layout.css +++ b/wp-content/themes/default/style.css @@ -1,7 +1,14 @@ -/* Default WordPress by Dave Shea || http://mezzoblue.com - Modifications by Matthew Mullenweg || http://photomatt.net - This is just a basic layout, with only the bare minimum defined. - Please tweak this and make it your own. :) +/* +Theme Name: Default +Theme URI: http://wordpress.org/ +Description: The default theme included with WordPress. +Version: 1.5 +Author: Dave Shea + +Default WordPress by Dave Shea || http://mezzoblue.com +Modifications by Matthew Mullenweg || http://photomatt.net +This is just a basic layout, with only the bare minimum defined. +Please tweak this and make it your own. :) */ a { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 380c311187..32ebdecbff 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1253,11 +1253,7 @@ function get_template() { function get_template_directory() { $template = get_template(); - if (empty($template) || $template == 'default') { - $template = ABSPATH . "wp-content"; - } else { - $template = ABSPATH . "wp-content/themes/$template"; - } + $template = ABSPATH . "wp-content/themes/$template"; return $template; } @@ -1330,41 +1326,6 @@ function get_themes() { } } - $default_files = array('wp-comments.php', 'wp-comments-popup.php', 'wp-comments-post.php', 'wp-footer.php', 'wp-header.php', 'wp-sidebar.php', 'footer.php', 'header.php', 'sidebar.php'); - - // Get the files for the default template. - $default_template_files = array(); - { - // Find the index. - if (file_exists(ABSPATH .'wp-content/index.php')) { - $default_template_files[] = 'wp-content/index.php'; - } else { - $default_template_files[] = 'index.php'; - } - - $dirs = array('', 'wp-content'); - foreach ($dirs as $dir) { - $template_dir = @ dir(ABSPATH . $dir); - while(($file = $template_dir->read()) !== false) { - if ( !preg_match('|^\.+$|', $file) && in_array($file, $default_files)) - $default_template_files[] = trim("$dir/$file", '/'); - } - } - } - - // Get the files for the default stylesheet. - $default_stylesheet_files = array(); - { - $stylesheet_dir = @ dir(ABSPATH); - while(($file = $stylesheet_dir->read()) !== false) { - if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file)) - $default_stylesheet_files[] = "$file"; - } - } - - // The default theme always exists. - $themes['Default'] = array('Name' => 'Default', 'Title' => 'WordPress Default', 'Description' => 'The default theme included with WordPress.', 'Author' => 'Dave Shea', 'Version' => '1.3', 'Template' => 'default', 'Stylesheet' => 'default', 'Template Files' => $default_template_files, 'Stylesheet Files' => $default_stylesheet_files, 'Template Dir' => '/', 'Stylesheet Dir' => '/', 'Parent Theme' => ''); - if (!$themes_dir || !$theme_files) { return $themes; } @@ -1397,35 +1358,27 @@ function get_themes() { $template = trim($template); - if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) { + if (! file_exists("$theme_root/$template/index.php")) { $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); continue; } $stylesheet_files = array(); - if ($stylesheet != 'default') { - $stylesheet_dir = @ dir("$theme_root/$stylesheet"); - if ($stylesheet_dir) { - while(($file = $stylesheet_dir->read()) !== false) { - if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) ) - $stylesheet_files[] = "$theme_loc/$stylesheet/$file"; - } + $stylesheet_dir = @ dir("$theme_root/$stylesheet"); + if ($stylesheet_dir) { + while(($file = $stylesheet_dir->read()) !== false) { + if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) ) + $stylesheet_files[] = "$theme_loc/$stylesheet/$file"; } - } else { - $stylesheet_files = $default_stylesheet_files; } $template_files = array(); - if ($template != 'default') { - $template_dir = @ dir("$theme_root/$template"); - if ($template_dir) { - while(($file = $template_dir->read()) !== false) { - if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) ) - $template_files[] = "$theme_loc/$template/$file"; - } + $template_dir = @ dir("$theme_root/$template"); + if ($template_dir) { + while(($file = $template_dir->read()) !== false) { + if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) ) + $template_files[] = "$theme_loc/$template/$file"; } - } else { - $template_files = $default_template_files; } $template_dir = dirname($template_files[0]); diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index 8cfa756dc2..e214bf8683 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -6,21 +6,21 @@ function get_header() { if ( file_exists( TEMPLATEPATH . '/header.php') ) load_template( TEMPLATEPATH . '/header.php'); else - load_template( ABSPATH . 'wp-includes/wp-header.php'); + load_template( ABSPATH . 'wp-content/themes/default/header.php'); } function get_footer() { if ( file_exists( TEMPLATEPATH . '/footer.php') ) load_template( TEMPLATEPATH . '/footer.php'); else - load_template( ABSPATH . 'wp-includes/wp-footer.php'); + load_template( ABSPATH . 'wp-content/themes/default/footer.php'); } function get_sidebar() { if ( file_exists( TEMPLATEPATH . '/sidebar.php') ) load_template( TEMPLATEPATH . '/sidebar.php'); else - load_template( ABSPATH . 'wp-includes/wp-sidebar.php'); + load_template( ABSPATH . 'wp-content/themes/default/sidebar.php'); } @@ -105,28 +105,16 @@ function get_bloginfo($show='') { break; case 'stylesheet_url': $output = get_stylesheet(); - if (empty($output) || $output == 'default') { - $output = get_settings('siteurl') . "/wp-includes/wp-layout.css"; - } else { - $output = get_settings('siteurl') . "/wp-content/themes/$output/style.css"; - } + $output = get_settings('siteurl') . "/wp-content/themes/$output/style.css"; break; case 'stylesheet_directory': $output = get_stylesheet(); - if (empty($output) || $output == 'default') { - $output = get_settings('siteurl'); - } else { - $output = get_settings('siteurl') . "/wp-content/themes/$output"; - } + $output = get_settings('siteurl') . "/wp-content/themes/$output"; break; case 'template_directory': case 'template_url': $output = get_template(); - if (empty($output) || $output == 'default') { - $output = get_settings('siteurl'); - } else { - $output = get_settings('siteurl') . "/wp-content/themes/$output"; - } + $output = get_settings('siteurl') . "/wp-content/themes/$output"; break; case 'admin_email': $output = get_settings('admin_email');