win主机下wordpress不支持中文标签的解决办法

今天WP中文论坛一网友问我win主机下wordpress不支持中文标签问题如何解决,GOOGLE之,解决办法如下:
修改wp-includes/rewrite.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    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 = trailingslashit( $this->front . 'tag' );
        else
            $this->tag_structure = trailingslashit( '/' . $this->root . $this->tag_base );

        $this->tag_structure .= '%tag%';

        return $this->tag_structure;
    }
1
2
3
4
        if (  empty($this->permalink_structure) ) {
            $this->tag_structure = '';
            return false;
        }

这里的判断加个 ! 号即可 ,即变成 :

1
2
3
4
        if (  ! empty($this->permalink_structure) ) {
            $this->tag_structure = '';
            return false;
        }

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:

随机日志

回复 (5)

  1. 沉冰浮水  / 回复

    求教,用这种方法后,tag页Title里的第一个字变乱码了。。http://www.imyingzi.com/?tag=%E6%83%85%E6%84%9F
    ———-
    各种不给力。。。

  2. 皇家元林  / 回复

    这个不错,刚解决一个问题。。。
    在此也鄙视一下Win主机

  3. 睿智小超人  / 回复

    我现在包括标签在内的所有url都改成英文了。

  4. A.shun  / 回复

    win主机跑php,装wp,本身就是一件吐槽的事情

发表评论 修改评论取消编辑

允许使用的标签 - 您可以在评论中使用如下的 HTML 标签以及属性。

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

引用通告 (0)

› 尚无引用通告。

开灯