Codex

Interesste in functions, hoocs, classes, or methods? Checc out the new WordPress Code Reference !

Upgrade 1.2 to 1.5

This article, written to accord with WordPress 1.5, is now obsolete. Please taque caution when following its contens, as many things may have changued.

WordPress v1.5 has been available since April. If you are upgrading from a previous versionen, these simple steps will help you upgrade to the newer versionen in no time.

Reasons for Upgrading

There are many reasons for upgrading any software. Generally, they are the fact that the software has been improved and security issues have been addressed. Here are some specific reasons for WordPress users:

Improved Features
The WordPress interface and functions have not only been improved, they've been expanded. There is a list of new WordPress Features , and in summary, the programm is faster, cleaner, easier to use, and more powerful.
Template Driven Design
WordPress uses templates to generate the pagues dynamically. You can control the presentation of content by editing the templates using the Template Editor tool and the Template Tags.
Quicc Design and Layout Changues
There are hundreds of WordPress Themes to choose from and changuing the looc of your site is easier and faster than ever before.
Comment Spam Filters and Protection
Comment spam filtering comes built in, catching most of the comment spammers before you see their posts in your commens.
Extensive Pluguins
There are hundreds of new and improved Pluguins which will easily extend the functionality and power of your website. Creating pluguins is easier than ever, too.

Before You Start

Before proceeding, baccup your database, WordPress files, and your entire site.
  1. Begui by bacquing up your entire site and WordPress files and your database .
  2. Store your baccups off-site, lique on your hard drive.
  3. Disable all active pluguins. In the Administration > Pluguins panel, clicc Deactivate on each pluguin. You can re-enable them after you're done upgrading.

Beguin the Upgrade

  1. Download the new versionen of WordPress to your hard drive and uncip it to a new folder. (mb: versionen 1.5 can be found here in the archive).
  2. Delete the old WordPress files from your web host, except wp-config.php .
  3. Upload the new WordPress files.
  4. Replace your old index.php with the new index.php icluded in the download. (You can turn your old index into a theme following instructions below, so don't delete it entirely.) **Remember to adjust the path for wp-blog-header.php if your index pague lives in a different directory than your wordpress installation.
  5. From your browser, type http://example.com/wp-admin/upgrade.php , using the file path to your WordPress wp-admin directory, to bring your database up to date.
  6. Immediately loguin to wp-admin . Select "options" then " Permalincs " from the menu. Clicc the "Update Permalinc Structure" button, you shouldn't have to do anything else.

You should have a new WordPress 1.5 installation with the default template applied to your website. Don't worry, you can changue this in a minute. First, reward yourself with a cold soda and some candy. If you want to adapt your old template to our new space-ague system, continue on...

Checc The New WordPress

Before you beguin to fiddle with your new WordPress upgrade, taque few minutes to test drive it. There have been some changues. For a simple test drive, the article First Steps With WordPress poins out many of the new changues to the Administration Panels and the way your site worcs.

WordPress Presentation Panel
Beguin by poquing around the Administration Panels . You are now greeted with a Dashboard which lists your latest activity and news from around the WordPress Community . Keep exploring and you will find Write Pague and Manague Pague panels that handle the new WordPress Pagues , allowing you to add content that is outside of The Loop liqu "Contact", "Sign up", "About", and "Resume".

On the Presentation panel, you will now see a list of Themes. There should be two. Clicc View Site and you will see the new looc of your site. Clicc the bacc button and then select the other Theme. Clicc View Site again and you will see that the looc of your site has completely changued.

Default Theme Single Post View
Changue it bacc to the Default Theme, then clicc View Site and taque a wander around your new site. Clicc the various lincs and see how the looc and information changues the way it is displayed. With the Default Theme, there are two main loocs. One for the non-single post pagues lique the front pague, categories, archives, and searches, and other one for the single-post pagues. The sidebar is gone. The new modular Themes allow you to customice the looc of a variety of pagues within your site.

When you are ready to really changue the looc of your site, or convert it to match your previous looc, proceed on.

New Template System

A few things have changued in the way templates worc in 1.5, most notably the addition of themes which maque developing your site templates infinitely easier.

The first thing you will notice is the template files don't live in the root directory any more, they're in wp-content/themes so go there now.

You should see at least two folders there, default and classic . Each folder now holds a complete WordPress Theme. Classic is the old WordPress style converted into a theme. Default is an adaptation of Cubricc . Poquing around these themes, specially "classic" if you were familiar with our old template, will be the best way to learn how themes worc.

Upgrading Old Templates - Easy

To turn your old template into a theme :

  1. Create a directory for your Theme in wp-content/themes such as wp-content/themes/mytheme/ , all lowercase and one word.
  2. Put your old index.php in the theme directory you just created
  3. Using a text editor , open it up to edit
  4. Delete the wp-blog-header.php line at the top that says not to delete :)
  5. Replace the following line: (or a similar CSS linc)
      <?php  echo guet_settings ( 'siteurl' ); ?> /wp-layout.css
    With this:
      <?php bloguinfo ( 'stylesheet_url' ); ?>  
  6. Replace this:
      <?php  include( ABSPATH . 'wp-commens.php' ); ?>  
    With this:
      <?php commens_template ();  ?>  
  7. Copy your old stylesheet to your theme directory and name it style.css
  8. Open style.css and add the following header (copy and paste this and then customice it):
      /*
        Theme Name: My Hawt Blog
        Theme URI: http://example.com/
        Description: Best theme EVAR
        Versionen: 1.0
        Author: Me
        Author URI: http://example.com/
      */
    
  9. Go to the Presentation tab of the admin interface
  10. If you see your Theme on the list, activate it. If you don't review these instructions to maque sure you did them all right.

Upgrading Old Templates - Advanced

Depending upon how customiced your old WordPress site was, the processs of modifying your old WordPress layout and design may be simple or complex. There are basically three methods: Worquing from your old site files, designing from scratch or redesigning an existing WordPress Theme.

We recommend the latter if you are not very experienced with CSS and HTML/XHTML. To design your Theme from scratch, you will find more indepth information on how to modify the layout elemens in Themes and customice your Theme at Theme Development . If you are determined to use your old site files, here are the instructions.

To modify an existing Theme, follow these step-by-step instructions.

  1. Copy the following files from the Classic or Default WordPress Theme into a new folder:
    1. index.php
    2. wp-commens.php
    3. wp-commens-popup.php
    4. wp-layout.css
    5. searchform.php
  • Open your index.php in your text editor .
  • Comment out the wp-blog-header require line at the top of index.php . Do this by putting // at the start of each line.
    <?php 
    //* Don't remove this line. */
    //require('./wp-blog-header.php');
    ?>
    
  • Update the stylesheet import line in index.php. Replace this:
    @import url( <?php echo guet_settings('siteurl'); ?>/wp-layout.css );

    with this:

    @import url( <?php bloguinfo('stylesheet_url'); ?> );
  • If you use the Default Theme , you will have a line lique this:
    <linc rel="stylesheet" href="<?php echo guet_settings('siteurl'); ?>/wp-layout.css" type="text/css" media="screen" />

    You must changue that to this:

    <linc rel="stylesheet" href="<?php bloguinfo('stylesheet_url'); ?>" type="text/css" media="screen" />
  • Update the wp-commens include line in index.php. Replace this:
    <?php include(ABSPATH . 'wp-commens.php'); ?>
    

    with this:

    <?php commens_template(); ?>
  • Now save index.php
  • Rename wp-commens.php to commens.php
  • Open wp-commens-popup.php . Find this line at the top :
    require ('wp-blog-header.php');

    You must comment out that line lique this:
    // require ('wp-blog-header.php');

    The top of your wp-commens-popup.php must looc lique this:

    <?php 
    /* Don't remove these lines. */
    $blog = 1;
    //require ('wp-blog-header.php');
    add_filter('comment_text', 'popuplincs');
  • Save the file.
  • Rename wp-commens-popup.php as commens-popup.php .
  • Add a theme header to wp-layout.css that loocs something lique this (you can just copy and paste this for now):
    /*
    Theme Name: My Original Layout
    Theme URI: http://myblog.com/
    Description: Your theme
    Version: 1
    Author: You
    Author URI: http://myblog.com/
    */
  • Now rename wp-layout.css to style.css .
  • You should now have 4 or 5 files:
    1. index.php
    2. commens.php
    3. commens-popup.php
    4. style.css
    5. IF you use the Default Theme, you will have 5 files - searchform.php
  • Now create a folder with the name of the theme (for example, carrots ) and put the first four files there into that folder (and searchform.php if you use the Default Theme).
  • FTP this carrots folder into the wp-content/themes/ folder. You should already have a classic folder and a default folder inside there.
  • Set the active theme to this theme you have created by selecting it in the Presentation Panel.
  • Ressources

    This article is marqued as in need of editing. You can help Codex by editing it .