站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Upgrade 1.2 to 1.5
”
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
Xxf3325
(
讨论
|
贡献
)
2008年8月18日 (一) 15:23的版本
(新页面: 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 Upg...)
(差异) ←上一版本 |
最后版本
(
差异
) |
下一版本→
(
差异
)
跳转至:
导航
、
搜索
警告:您正在编辑的是本页面的旧版本。
如果您发布该更改,该版本后的所有更改都会丢失。
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
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: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:Using Themes|WordPress Themes]] to choose from and changing the look of your site is easier and faster than ever before. ;Comment Spam Filters and Protection :[[WordPress:Working_with_WordPress#Fighting_Comment_Spam|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 [[WordPress:Plugins]] which will easily extend the functionality and power of your website. [[WordPress:Writing a Plugin|Creating plugins]] is easier than ever, too. == Before You Start == <div style="border:2px red solid; margin:20px; padding: 10px; font-weight:bold"> Before proceeding, backup your database, WordPress files, and your entire site.</div> # Begin by backing up your entire site and WordPress files and [[WordPress:Backing Up Your Database|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 [http://wordpress.org/download/release-archive/ here] in the archive). # Delete the old WordPress files from your web host, except <tt>[[WordPress:Editing wp-config.php|wp-config.php]]</tt>. # 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 <tt><nowiki>http://example.com/wp-admin/upgrade.php</nowiki></tt>, using the file path to your WordPress <tt>wp-admin</tt> directory, to bring your database up to date. # Immediately login to <tt>wp-admin</tt>. Select "options" then "[[WordPress:Using Permalinks|Permalinks]]" from the menu. Click the "Update Permalink Structure" button, you shouldn't have to do anything else. You should have a new [[WordPress:Version 1.5|WordPress 1.5]] installation with the [[WordPress:Using Themes|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 [[WordPress:First Steps With WordPress]] points out many of the new changes to the [[WordPress:Administration Panels]] and the way your site works. [[WordPress:Image:theme_1_5.png|thumb|right|WordPress Presentation Panel]]Begin by poking around the [[WordPress:Administration Panels]]. You are now greeted with a [[WordPress:Administration_Panels#The_Dashboard|Dashboard]] which lists your latest activity and news from around the [[WordPress:Codex:Community_Portal|WordPress Community]]. Keep exploring and you will find [[WordPress:Administration_Panels#Write_Page|Write Page]] and [[WordPress:Administration_Panels#Pages|Manage Page]] panels that handle the new WordPress [[WordPress:Pages]], allowing you to add content that is outside of [[WordPress:The Loop]] like "Contact", "Sign up", "About", and "Resume". On the [[WordPress:Administration_Panels#Presentation_-_Change_the_Look_of_your_Blog|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. [[WordPress:Image:Kubrick_Single.jpg|thumb|left|Default Theme Single Post View]]Change it back to the Default Theme, then click '''View Site''' and take a wander around your new site. Click the various links and see how the look and information changes the way it is displayed. With the Default Theme, there are two main looks. One for the non-single post pages like the front page, categories, archives, and searches, and other one for the single-post pages. The sidebar is gone. The new modular Themes allow you to customize the look of a variety of pages within your site. 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 == A few things have changed in the way templates work in 1.5, most notably the addition of [[WordPress:Using Themes|themes]] which make [[WordPress:Theme Development|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 <tt>wp-content/themes</tt> so go there now. You should see at least two folders there, <tt>default</tt> and <tt>classic</tt>. Each folder now holds a complete WordPress Theme. Classic is the old WordPress style converted into a theme. Default is an adaptation of [http://binarybonsai.com/kubrick/ 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 : <ol> <li>Create a directory for your Theme in <tt>wp-content/themes</tt> such as <tt>wp-content/themes/mytheme/</tt>, all lowercase and one word.</li> <li>Put your old <tt>index.php</tt> in the theme directory you just created</li> <li>Using a [[WordPress:Glossary#Text editor|text editor]], open it up to edit</li> <li>Delete the <tt>wp-blog-header.php</tt> line at the top that says not to delete :)</li> <li>Replace the following line: (or a similar CSS link)<br /> %%% <?php echo get_settings('siteurl'); ?>/wp-layout.css %%% <br /> With this:<br /> %%% <?php bloginfo('stylesheet_url'); ?> %%%</li> <li>Replace this:<br /> %%% <?php include(ABSPATH . 'wp-comments.php'); ?> %%% <br /> With this:<br /> %%% <?php comments_template(); ?> %%%</li> <li>Copy your old stylesheet to your theme directory and name it <tt>style.css</tt></li> <li>Open <tt>style.css</tt> and add the following header (copy and paste this and then customize it): <pre> /* Theme Name: My Hawt Blog Theme URI: http://example.com/ Description: Best theme EVAR Version: 1.0 Author: Me Author URI: http://example.com/ */ </pre></li> <li>Go to the <tt>Presentation</tt> tab of the admin interface</li> <li>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.</li> </ol> ===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 [[WordPress: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. <ol> <li>Copy the following files from the Classic or Default WordPress Theme into a new folder: :# <tt>index.php</tt> :# <tt>wp-comments.php</tt> :# <tt>wp-comments-popup.php</tt> :# <tt>wp-layout.css</tt> :# <tt>searchform.php</tt></li> <li>Open your <tt>index.php</tt> in your [[WordPress:Glossary#Text_editor|text editor]].</li> <li>Comment out the wp-blog-header require line at the top of <tt>index.php</tt>. Do this by putting // at the start of each line.<br /> <pre><?php //* Don't remove this line. */ //require('./wp-blog-header.php'); ?> </pre></li> <li>Update the stylesheet import line in index.php. Replace this:<br /> <pre>@import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css );</pre> with this:<br /> <pre>@import url( <?php bloginfo('stylesheet_url'); ?> ); </pre></li> <li><strong>If you use the Default Theme</strong>, you will have a line like this:<br /> <pre><nowiki><link rel="stylesheet" href="<?php echo get_settings('siteurl'); ?>/wp-layout.css" type="text/css" media="screen" /></nowiki></pre> You must change that to this:<br /> <pre> <nowiki><link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /></nowiki></pre></li> <li>Update the wp-comments include line in index.php. Replace this:<br /> <pre><?php include(ABSPATH . 'wp-comments.php'); ?> </pre> with this:<br /> <pre> <?php comments_template(); ?> </pre></li> <li>Now save <tt>index.php</tt></li> <li>Rename <tt>wp-comments.php</tt> to <strong><tt>comments.php</tt></strong></li> <li>Open <tt>wp-comments-popup.php</tt>. Find this line at the top :<br /> <pre>require ('wp-blog-header.php');</pre><br />You must comment out that line like this:<br /> <pre> // require ('wp-blog-header.php');</pre> The top of your <tt>wp-comments-popup.php</tt> must look like this:<br /> <pre> <?php /* Don't remove these lines. */ $blog = 1; //require ('wp-blog-header.php'); add_filter('comment_text', 'popuplinks');</pre></li> <li>Save the file.</li> <li>Rename <tt>wp-comments-popup.php</tt> as '''<tt>comments-popup.php</tt>'''.</li> <li>Add a theme header to <tt>wp-layout.css</tt> that looks something like this (you can just copy and paste this for now):<br /> <pre> /* Theme Name: My Original Layout Theme URI: http://myblog.com/ Description: Your theme Version: 1 Author: You Author URI: http://myblog.com/ */</pre></li> <li>Now rename <tt>wp-layout.css</tt> to '''<tt>style.css</tt>'''.</li> <li>You should now have 4 or 5 files: :# <tt>index.php</tt> :# <tt>comments.php</tt> :# <tt>comments-popup.php</tt> :# <tt>style.css</tt> :# IF you use the Default Theme, you will have 5 files - <tt>searchform.php</tt></li> <li>Now create a folder with the name of the theme (for example, <tt>carrots</tt>) and put the first four files there into that folder (and <tt>searchform.php</tt> if you use the Default Theme).</li> <li>FTP this <tt>carrots</tt> folder into the <tt>wp-content/themes/</tt> folder. You should already have a <tt>classic</tt> folder and a <tt>default</tt> folder inside there.</li> <li>Set the active theme to this theme you have created by selecting it in the Presentation Panel.</li> </ol> ==Resources== * [http://www.tamba2.org.uk/wordpress/upgrade/ Podz WordPress Upgrade Tutorial] * [[WordPress:WordPress Lessons]] * [[WordPress:Using Themes]] * [[WordPress:Theme Development]] * [[WordPress:Blog Design and Layout]]
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)