解决WordPress中文标签问题
一次一次的忘,一次一次的改……汗流成海= =
在WordPress中中文Tag被定义为ASCII码,所以当搜索或者是通过Tag访问文章时会出现ASCII乱码路径的现象,解决办法:
1.首先找到/wp-includes/rewrite.php 文件(在操作前请将其备份,以免修改出错。);
2.打开 rewrite.php 文件找到一下代码:
function get_tag_permastruct() {
if (isset($this->tag_structure)) {
return $this->tag_structure;
}
if (empty($this->permalink_structure)) {
$this->tag_structure = ”;
return false;
}
if (empty($this->tag_base))
$this->tag_structure = $this->front . ‘tag/’;
else
$this->tag_structure = $this->tag_base . ‘/’;
$this->tag_structure .= ‘%tag%’;
return $this->tag_structure;
3.修改那行蓝色的代码,修改为:
if (! empty($this->permalink_structure)) {
就是在empty…前添加上一个英文的叹号”!”。
4.保存!
This entry is filed under WordPress. And tagged with tag, wordpress, 中文标签, 乱码. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
路过,Very Good!
[回复]
你好,非常谢谢你,这样中文标签的问题是解决了,但是中文分类依然无法显示,请问,对于中文分类,有什么好的解决办法吗?
[回复]
呵呵,看了你的博客,灵感来了,,中文分类解决了
[回复]