Make WordPress Core

Changeset 2032


Ignore:
Timestamp:
01/02/2005 02:47:45 AM (20 years ago)
Author:
rboren
Message:

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.

Location:
trunk
Files:
8 added
6 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r2009 r2032  
    22/* Don't remove this line. */
    33require('./wp-blog-header.php');
    4 get_header();
    54?>
    6 
    7 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    8 
    9 <?php the_date('','<h2>','</h2>'); ?>
    10    
    11 <div class="post">
    12      <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    13     <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    14    
    15     <div class="storycontent">
    16         <?php the_content(__('(more...)')); ?>
    17     </div>
    18    
    19     <div class="feedback">
    20             <?php wp_link_pages(); ?>
    21             <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    22     </div>
    23    
    24     <!--
    25     <?php trackback_rdf(); ?>
    26     -->
    27 
    28 </div>
    29 
    30 <?php comments_template( is_single() ); // Get wp-comments.php template ?>
    31 
    32 <?php endwhile; else: ?>
    33 <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    34 <?php endif; ?>
    35 
    36 <?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    37 
    38 <?php get_footer(); ?>
  • trunk/wp-includes/functions.php

    r2027 r2032  
    12541254    $template = get_template();
    12551255
    1256     if (empty($template) || $template == 'default') {
    1257         $template = ABSPATH . "wp-content";
    1258     } else {
    1259         $template = ABSPATH . "wp-content/themes/$template";
    1260     }
     1256    $template = ABSPATH . "wp-content/themes/$template";
    12611257
    12621258    return $template;
     
    13311327    }
    13321328
    1333     $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');
    1334 
    1335     // Get the files for the default template.
    1336     $default_template_files = array();
    1337     {
    1338         // Find the index.
    1339         if (file_exists(ABSPATH  .'wp-content/index.php')) {
    1340             $default_template_files[] = 'wp-content/index.php';
    1341         } else {
    1342             $default_template_files[] = 'index.php';
    1343         }
    1344        
    1345         $dirs = array('', 'wp-content');
    1346         foreach ($dirs as $dir) {
    1347             $template_dir = @ dir(ABSPATH . $dir);
    1348             while(($file = $template_dir->read()) !== false) {
    1349                 if ( !preg_match('|^\.+$|', $file) && in_array($file, $default_files))
    1350                     $default_template_files[] = trim("$dir/$file", '/');
    1351             }
    1352         }
    1353     }
    1354 
    1355     // Get the files for the default stylesheet.
    1356     $default_stylesheet_files = array();
    1357     {
    1358         $stylesheet_dir = @ dir(ABSPATH);
    1359         while(($file = $stylesheet_dir->read()) !== false) {
    1360             if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file))
    1361                 $default_stylesheet_files[] = "$file";
    1362         }
    1363     }
    1364    
    1365     // The default theme always exists.
    1366     $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' => '');
    1367 
    13681329    if (!$themes_dir || !$theme_files) {
    13691330        return $themes;
     
    13981359        $template = trim($template);
    13991360
    1400         if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) {
     1361        if (! file_exists("$theme_root/$template/index.php")) {
    14011362            $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
    14021363            continue;
     
    14041365       
    14051366        $stylesheet_files = array();
    1406         if ($stylesheet != 'default') {
    1407             $stylesheet_dir = @ dir("$theme_root/$stylesheet");
    1408             if ($stylesheet_dir) {
    1409                 while(($file = $stylesheet_dir->read()) !== false) {
    1410                     if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) )
    1411                         $stylesheet_files[] = "$theme_loc/$stylesheet/$file";
    1412                 }
     1367        $stylesheet_dir = @ dir("$theme_root/$stylesheet");
     1368        if ($stylesheet_dir) {
     1369            while(($file = $stylesheet_dir->read()) !== false) {
     1370                if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) )
     1371                    $stylesheet_files[] = "$theme_loc/$stylesheet/$file";
    14131372            }
    1414         } else {
    1415             $stylesheet_files = $default_stylesheet_files;
    14161373        }
    14171374
    14181375        $template_files = array();     
    1419         if ($template != 'default') {
    1420             $template_dir = @ dir("$theme_root/$template");
    1421             if ($template_dir) {
    1422                 while(($file = $template_dir->read()) !== false) {
    1423                     if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) )
    1424                         $template_files[] = "$theme_loc/$template/$file";
    1425                 }
     1376        $template_dir = @ dir("$theme_root/$template");
     1377        if ($template_dir) {
     1378            while(($file = $template_dir->read()) !== false) {
     1379                if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) )
     1380                    $template_files[] = "$theme_loc/$template/$file";
    14261381            }
    1427         } else {
    1428             $template_files = $default_template_files;
    14291382        }
    14301383
  • trunk/wp-includes/template-functions-general.php

    r2023 r2032  
    77        load_template( TEMPLATEPATH . '/header.php');
    88    else
    9         load_template( ABSPATH . 'wp-includes/wp-header.php');
     9        load_template( ABSPATH . 'wp-content/themes/default/header.php');
    1010}
    1111
     
    1414        load_template( TEMPLATEPATH . '/footer.php');
    1515    else
    16         load_template( ABSPATH . 'wp-includes/wp-footer.php');
     16        load_template( ABSPATH . 'wp-content/themes/default/footer.php');
    1717}
    1818
     
    2121        load_template( TEMPLATEPATH . '/sidebar.php');
    2222    else
    23         load_template( ABSPATH . 'wp-includes/wp-sidebar.php');
     23        load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');
    2424}
    2525
     
    106106    case 'stylesheet_url':
    107107        $output = get_stylesheet();
    108         if (empty($output) || $output == 'default') {
    109             $output = get_settings('siteurl') . "/wp-includes/wp-layout.css";
    110         } else {
    111             $output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
    112         }
     108        $output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
    113109        break;
    114110    case 'stylesheet_directory':
    115111        $output = get_stylesheet();
    116         if (empty($output) || $output == 'default') {
    117             $output = get_settings('siteurl');
    118         } else {
    119             $output = get_settings('siteurl') . "/wp-content/themes/$output";
    120         }
     112        $output = get_settings('siteurl') . "/wp-content/themes/$output";
    121113        break;
    122114    case 'template_directory':
    123115    case 'template_url':
    124116        $output = get_template();
    125         if (empty($output) || $output == 'default') {
    126             $output = get_settings('siteurl');
    127         } else {
    128             $output = get_settings('siteurl') . "/wp-content/themes/$output";
    129         }
     117        $output = get_settings('siteurl') . "/wp-content/themes/$output";
    130118        break;
    131119    case 'admin_email':
Note: See TracChangeset for help on using the changeset viewer.