首页 > WordPress > 解决WordPress中文标签问题

解决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.保存!

  1. 2008年8月22日00:37 | #1

    路过,Very Good!

  2. sky
    2008年10月19日22:39 | #2

    你好,非常谢谢你,这样中文标签的问题是解决了,但是中文分类依然无法显示,请问,对于中文分类,有什么好的解决办法吗?

  3. sky
    2008年10月19日22:44 | #3

    呵呵,看了你的博客,灵感来了,,中文分类解决了

    eroading Reply:

    我按你的做法为什么还是会出现乱码?盼回

    Reply:

    是这段函数下的么?function get_tag_permastruct()
    if (empty($this->permalink_structure))这代码有好几句呢。。

    Reply:

    我看你的博客没有这个问题啊。。

  4. 2010年1月21日11:56 | #4

    博主你好,我更改了您说的设置,怎么还是不行哦?^_^

    binforever Reply:

    注意一下前后行,类似的有好几句……

  1. 2009年7月19日00:14 | #1