找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
积分等级发帖收益的说明江阴论坛帮助汇总江阴论坛管理规则(必看)江阴论坛版主招聘中江阴论坛已运行
查看: 2206|回复: 0

[WordPress] 解决WordPress中文标签问题

[复制链接]
发表于 2010-4-15 11:54:03 | 显示全部楼层 |阅读模式
在WordPress中中文Tag被定义为ASCII码,所以当搜索或者是通过Tag访问文章时会出现ASCII乱码路径的现象,解决办法:
1.首先找到/wp-includes/rewrite.php 文件(在操作前请将其备份,以免修改出错。);
2.打开 rewrite.php 文件找到一下代码:
  1. function get_tag_permastruct() {
  2. if (isset($this->tag_structure)) {
  3. return $this->tag_structure;
  4. }
  5. if (empty($this->permalink_structure)) {
  6. $this->tag_structure = ”;
  7. return false;
  8. }
  9. if (empty($this->tag_base))
  10. $this->tag_structure = $this->front . ‘tag/’;
  11. else
  12. $this->tag_structure = $this->tag_base . ‘/’;
  13. $this->tag_structure .= ‘%tag%’;
  14. return $this->tag_structure;
复制代码
3.代码
  1. if (empty($this->permalink_structure)) {
复制代码
修改为:
  1. if (! empty($this->permalink_structure)) {
复制代码
就是在empty…前添加上一个英文的叹号”!”。
4.保存!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|江阴人家

GMT+8, 2024-3-29 23:22 , Processed in 0.017269 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表