Upgrade 1.2 to 1.5
This Template is used by Codex:Template Messages.
pre 检查到模板循环：模板:Message /pre
WordPress v1.5 has been available since April. If you are upgrading from a previous version, these simple steps will help you upgrade to the newer version 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 program is faster, cleaner, easier to use, and more powerful.
- Template Driven Design
- WordPress uses templates to generate the pages dynamically. You can control the presentation of content by editing the templates using the Template Editor tool and the Template Tags.
- Quick Design and Layout Changes
- There are hundreds of WordPress Themes to choose from and changing the look 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 comments.
- Extensive Plugins
- There are hundreds of new and improved Plugins which will easily extend the functionality and power of your website. Creating plugins is easier than ever, too.
Before You Start
- Begin by backing up your entire site and WordPress files and your database.
- Store your backups off-site, like on your hard drive.
- Disable all active plugins. In the Administration > Plugins panel, click Deactivate on each plugin. You can re-enable them after you're done upgrading.
Begin the Upgrade
- Download the new version of WordPress to your hard drive and unzip it to a new folder. (nb: version 1.5 can be found here in the archive).
- Delete the old WordPress files from your web host, except wp-config.php.
- Upload the new WordPress files.
- 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 page lives in a different directory than your wordpress installation.
- 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.
- Immediately login to wp-admin. Select "options" then "Permalinks" from the menu. Click the "Update Permalink 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 change 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-age system, continue on...
Check The New WordPress
Before you begin to fiddle with your new WordPress upgrade, take few minutes to test drive it. There have been some changes. For a simple test drive, the article First Steps With WordPress points out many of the new changes to the Administration Panels and the way your site works.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 Page and Manage Page panels that handle the new WordPress Pages, allowing you to add content that is outside of The Loop like "Contact", "Sign up", "About", and "Resume".
On the Presentation panel, you will now see a list of Themes. There should be two. Click View Site and you will see the new look of your site. Click the back button and then select the other Theme. Click View Site again and you will see that the look of your site has completely changed.
When you are ready to really change the look of your site, or convert it to match your previous look, proceed on.
New Template System
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 Kubrick. Poking around these themes, especially "classic" if you were familiar with our old template, will be the best way to learn how themes work.
Upgrading Old Templates - Easy
To turn your old template into a theme :
- Create a directory for your Theme in wp-content/themes such as wp-content/themes/mytheme/, all lowercase and one word.
- Put your old index.php in the theme directory you just created
- Using a text editor, open it up to edit
- Delete the wp-blog-header.php line at the top that says not to delete :)
- Replace the following line: (or a similar CSS link)
%%% <?php echo get_settings('siteurl'); ?>/wp-layout.css %%%
%%% <?php bloginfo('stylesheet_url'); ?> %%%
- Replace this:
%%% <?php include(ABSPATH . 'wp-comments.php'); ?> %%%
%%% <?php comments_template(); ?> %%%
- Copy your old stylesheet to your theme directory and name it style.css
- Open style.css and add the following header (copy and paste this and then customize it):
/* Theme Name: My Hawt Blog Theme URI: http://example.com/ Description: Best theme EVAR Version: 1.0 Author: Me Author URI: http://example.com/ */
- Go to the Presentation tab of the admin interface
- If you see your Theme on the list, activate it. If you don't review these instructions to make sure you did them all right.
Upgrading Old Templates - Advanced
Depending upon how customized your old WordPress site was, the process of modifying your old WordPress layout and design may be simple or complex. There are basically three methods: Working 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 elements in Themes and customize 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.
- Copy the following files from the Classic or Default WordPress Theme into a new folder:
<?php //* Don't remove this line. */ //require('./wp-blog-header.php'); ?>
@import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css );
@import url( <?php bloginfo('stylesheet_url'); ?> );
<link rel="stylesheet" href="<?php echo get_settings('siteurl'); ?>/wp-layout.css" type="text/css" media="screen" />
You must change that to this:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php include(ABSPATH . 'wp-comments.php'); ?>
<?php comments_template(); ?>
You must comment out that line like this:
// require ('wp-blog-header.php');
The top of your wp-comments-popup.php must look like this:
<?php /* Don't remove these lines. */ $blog = 1; //require ('wp-blog-header.php'); add_filter('comment_text', 'popuplinks');
/* Theme Name: My Original Layout Theme URI: http://myblog.com/ Description: Your theme Version: 1 Author: You Author URI: http://myblog.com/ */
- IF you use the Default Theme, you will have 5 files - searchform.php
includeonlydiv style=clear:both; background-color:#EEEEFF; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;This article is marked as in need of editing. You can help Codex by editing it./div/includeonlynoinclude
This Template is used by Codex:Template Messages.
pre 检查到模板循环：模板:Message /pre