删除类别和来自WordPress网址的标记库-没有插件 [英] Remove category & tag base from WordPress url - without a plugin

查看:70
本文介绍了删除类别和来自WordPress网址的标记库-没有插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要删除类别& WordPress URL中的标记库.我遇到了其他使用插件的帖子和解决方案.我想远离插件,并从functions.php内部获得解决方案.这样可以防止将来更改任何插件更新或WordPress默认文件.

I would like to remove the category & tag base from WordPress URL. I have come across other posts and solutions which used plugins. I would like to stay away from plugins and have a solution from within functions.php. This would prevent any future plugin updates or WordPress default files from being changed.

任何帮助将不胜感激.谢谢!

Any help would be appreciated. Thanks!

到目前为止,我已经尝试了以下解决方案:

I have tried these solutions so far:

  • This htaccess solution did not work: http://mikepayne.co/2011/remove-category-base-from-url/
  • These methods also failed: http://www.askapache.com/wordpress/remove-category-wordpress-urls.html

推荐答案

如果要从网址中删除/category/,请执行以下两个步骤:

If you want to remove /category/ from the url, follow these two steps:

  1. 转到设置" >>永久链接",然后选择自定义",然后输入:/%category%/%postname%/
  2. 接下来将您的类别库"设置为.
  1. Go to Settings >> Permalinks and select Custom and enter: /%category%/%postname%/
  2. Next set your Category Base to .

保存它,您将看到URL更改为以下格式: http://yourblog.com/quotes/

Save it and you’ll see your URL changed to this format: http://yourblog.com/quotes/

(来源: http://premium.wpmudev.org/blog/daily-tip-quick-trick-to-remove-category-from-wordpress-url/)

这篇关于删除类别和来自WordPress网址的标记库-没有插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆