2

我已经为此设置了永久链接

> /%postname%/

但是在 url 中,如果帖子有一个类别,它仍然显示在 url

是否可以更改进行更改,以便此 url:

http://www.website.com.au/post-category/post-name/

对此

http://www.website.com.au/post-name/

htaccess 看起来像这样

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
4

3 回答 3

2

安装无类别基础插件:http ://wordpress.org/extend/plugins/wp-no-category-base/

于 2012-10-15T13:30:43.897 回答
2

以前的插件将从 URL 中删除类别词。如果您想删除类别,还请尝试以下插件: http ://wordpress.org/extend/plugins/remove-parents/

于 2012-10-17T09:17:47.400 回答
1

如果您使用的是 Yoast 插件,您可以转到高级 > 永久链接 > 从类别 URL 中剥离类别库。

或者,我写了一篇关于如何在没有下面插件的情况下剥离类别 url 的博客文章。

http://jonnyjordan.com/blog/how-to-remove-category-from-your-urls-in-wordpress/

于 2015-08-23T14:12:42.557 回答