wordpress伪静态url中去掉category目录的方法
wordpress自定义伪静态路径的时候,系统会自动给路径加上category目录,看着有点不爽,同时也增加了url的长度。下面是删除category的方法之一:
这里的方法是直接修改程序删除category目录
打开wp-includes/目录下的rewrite.php文件,找到:
$this->category_structure = trailingslashit( $this->front . ‘category’ );
替换为:
$this->category_structure = trailingslashit( $this->front);
保存上传到服务器即可