[wp-hackers] Themes: Moving from 1.2.x to 1.5

Ryan Boren ryan at boren.nu
Sun Jan 30 08:04:49 GMT 2005


http://codex.wordpress.org/Using_Themes#Moving_from_1.2.x_to_1.5_BETA_-
_SUBJECT_TO_CHANGE_AT_ANY_TIME

Here are some notes pertaining to theme/template upgrades.  I tried
sending to the docs lists but it seems to have black holed.  Anyhoo...

Upgrading templates from 1.2.x to 1.5 is automatically done during
upgrade if wp-content/themes is writable.  A theme named after the
weblog title is automatically created from the existing template files
and made the active theme.  We should mention somewhere that wp-
content/themes should be made writable before install/upgrade.  Perhaps
the install/upgrade itself should check for this and warn.

If someone wants to upgrade manually, here are the steps.

* Create a wp-content/themes/theme-name directory.
* Copy index.php to the theme directory.
* Comment out the wp-blog-header require line at the top of index.php.
* Update the stylesheet import line in index.php. Replace this:
    <?php echo get_settings('siteurl'); ?>/wp-layout.css
  with this:
    <?php bloginfo('stylesheet_url'); ?>
* Update the wp-comments include line in index.php.  Replace this:
    <?php include(ABSPATH . 'wp-comments.php'); ?>
  with this:
    <?php comments_template(); ?>
* Copy wp-comments.php to comments.php in the theme directory.
* Copy wp-comments-popup.php to comments-popup.php in the theme
directory.
* Update the path in the wp-blog-header require line at the top of
comments-popup.php.  Replace this:
    require ('wp-blog-header.php');
  with this:
    require ('../../../wp-blog-header.php');
* Copy wp-layout.css to style.css in the theme directory.
* Add a theme header to style.css.  Something like this:
  /*
    Theme Name: My Blog
    Theme URI: http://myblog.com/
    Description: Your theme
    Version: 1
    Author: You
    Author URI: http://myblog.com/
  */
* Done.


During a first time install of 1.5, a site theme is automatically
created if wp-content/themes is writable.  The site theme is a copy of
the default theme with a modified theme header.  It is named after the
blog title.  Users should be encouraged to avoid making modifications
directly to themes shipped with WP (Default and Classic).  They should
be copied to another theme directory and renamed.  This avoids the
overwrite-during-upgrade problems.

Ryan



More information about the hackers mailing list