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

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

问题描述

我想删除类别 &来自 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:

推荐答案

如果要从 url 中删除 /category/,请按照以下两个步骤操作:

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

  1. 转到设置>>固定链接并选择自定义并输入:/%category%/%postname%/
  2. 接下来将您的类别基础设置为 .

保存它,您会看到您的 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 url 的标签库 - 没有插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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