最后更新时间:2010.01.03
终于在WP中文官网看见2.8简体中文版,还是忍不住马上升级了,之前所谓观望,其实也就是在等官方的正式版吧 x(
下面是升级必做的事,罗列一下,以备查看
【禁用AutoSave】
打开以下文件
wp-admin/post-new.php
wp-admin/post.php
wp-admin/page-new.php
wp-admin/page.php
在wp_enqueue_script('autosave');行前加“//”,将语句注释掉
【禁用Revisions】
在wp-config.php中加入语句
define('WP_POST_REVISIONS', false);
【去掉Meta中的官方链接】
打开wp-includes\default-widgets.php,查找“wordpress.org”所在行,将此行注释掉,或者将“[li]...[/li]”中的内容替换成想要的内容。(例如:<a href="http://mail.miyui.net" target="_blank">eMail</a>)
【修改摘要长度】
打开wp-includes\formatting.php,修改excerpt长度“55”为“3”
[hidepost=9]WordPress默认的生成摘要是用空格来判断的,就是取到55个空格结束,这适用于西方采用空格作为词间隔的语言,但中文是不分词的,所以我使用读取3行的方式,取前3行,对哪种语言都是适用的。[/hidepost]
【升级后无法进入后台】
“Warning: Cannot modify header information - headers already sent by (output started at .../wp-config.php:1) in .../wp-includes/pluggable.php on line 865”
解决方法:把wp-config.php文件另存为ANSI编码
【添加备案信息后不能显示中文】
找到所用主题的footer.php文件,用Dreamweaver打开,执行“修改”→“页面属性”→“标题/编码”→“Unicode(UTF-
”
【配置PageNavi】
cellarheat模板:将index.php和category.php中的以下代码注释掉
< ?php next_posts_link('Older Entries') ?>< ?php previous_posts_link('Newer Entries') ?>
并添加
< ?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
【禁用全角半角自动转换】
打开/wp-includes/formatting.php,找到以下4行代码,然后全部注释掉
// static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
【禁止评论中的链接自动转换】
打开wp-includes\formatting.php,搜索function _make_url_clickable_cb修改:
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>";
为:
return $matches[1] . "$url";
【修改标签云】
打开wp-includes\category-template.php,修改“smallest”长度为“6”,修改“largest”长度为“15”,修改“number”长度为“20”。
【保留文件】
\wp-admin\images\logo-login.gif
\wp-content\plugins
\wp-content\themes
\wp-includes\images\smilies
[hidepost=9]
【清理Revisions】
法一:安装Delete-Revision插件
法二:运行SQL命令
【评论倒叙显示】
修改wp-includes/comment-template.php文件中的
ORDER BY comment_date_gmt
为
ORDER BY comment_date_gmt DESC
[/hidepost]
Author:
Author: 
最新评论