简体   繁体   English

如何将“项目”永久链接更改为Wordpress中帖子的类别

[英]How to change the 'Projects' permalink to the Category of the post in Wordpress

I would like to change the permalinks for projects to use the specific post's parent category name. 我想更改项目的永久链接以使用特定帖子的父类别名称。 Is this possible? 这可能吗? I have come across a few tutorials via Google, though none seem specific to this cause. 我通过Google遇到了一些教程,尽管似乎没有专门针对此原因的教程。

I am currently using the Wordpress Projects section for Events and a Menu (restaurant). 我目前正在使用“ WordPress项目”部分的“事件”和“菜单”(餐厅)。 I would like the URLs associated with the posts in each of those categories to be /events/post-name and /menu/post-name 我希望与每个类别中的帖子相关的URL为/ events / post-name和/ menu / post-name

From: 从:

www.website.com/projects/post-name www.website.com/projects/post-name

To: 至:

www.website.com/events/post-name www.website.com/events/post-name

www.website.com/menu/post-name www.website.com/menu/post-name

The Yoast SEO plugin can help you for doing this kind of URL manipulation. Yoast SEO插件可以帮助您进行这种URL操作。

Also, it seems you need to create Custom Post Types for your different kinds of contents. 另外,似乎您需要为不同种类的内容创建自定义帖子类型 In your case, you can create an Events post type and a Menu post type. 在您的情况下,您可以创建事件帖子类型和菜单帖子类型。

There are several plugins available to help you with Custom Post Types, for exemple: Custom Post Type UI , Toolset Types ... 例如,有几个插件可用于帮助您自定义帖子类型: 自定义帖子类型UI工具集类型 ...

And this one: post-type-switcher can be useful if you want to transfer your existing content in a newly created Post Type. 如果您想在新创建的帖子类型中传输现有内容,那么这个: 帖子类型切换器会很有用。

Hope it will help 希望对你有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM