Skip to content

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

2010 七月 10
tags:
by 荒野无灯

今天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填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=3978

5 Responses Post a comment
  1. 十一月 23, 2010

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

  2. 九月 13, 2010

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

  3. 八月 7, 2010

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

  4. 七月 11, 2010

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

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

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

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

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS