简体   繁体   English

自定义WordPress永久链接结构

[英]Custom WordPress permalink structure

Is it possible to have the following structure, and if so, how: 是否可以具有以下结构,如果是,则如何:

  • www.example.com/ something (A custom archive page with posts from a certain post category ['poca'] and a certain custom post type ['cuty']) www.example.com/ 某些内容 (一个自定义存档页面,其中包含来自某个帖子类别['poca']和某个自定义帖子类型['cuty']的帖子)
  • www.example.com/ something /beautiful (A post of category ['poca']) www.example.com/ 东西 /美丽(类别的职位[“犯罪所得”])
  • www.example.com/ something /ugly (A post of my custom post type ['cuty']) www.example.com/ something / ugly(我的自定义帖子类型为['cuty']的帖子)

I can achieve to get my custom archive page to work. 我可以实现使自定义存档页面正常工作。 Moreover everything works so that 'poca' and 'cuty' takes the same template. 此外,一切正常,因此“ poca”和“ cuty”采用相同的模板。 But coming from something to one of these posts, it takes the normal permalink (category-name or custom-post-type) instead of something 但是,从某物到这些帖子之一,它需要常规的永久链接(类别名称或自定义帖子类型),而不是某些东西

Is there a way to achieve that it takes my custom archive page into the url instead? 有没有一种方法可以将我的自定义存档页面放入url中?

By the way: I am able to achieve the result by using a custom shortcode for my custom post type and then creating a new post with that shortcode in the wanted category, but this brings a consistency problem, as there's always the need to create two posts for the one thing I'd like to have. 顺便说一句:我可以通过为自定义帖子类型使用自定义简码,然后在想要的类别中使用该短代码创建新帖子来实现结果,但这带来了一致性问题,因为始终需要创建两个发布我想拥有的一件事。

So I finally found a solution. 所以我终于找到了解决方案。 Seems not the best way but it's ok for me to do it this way... 似乎不是最好的方法,但是我可以用这种方法来做...

Through using the plugin "Custom Permalinks" I can add the permalink I want, so I only need to add something for all my new posts in that category and all new posts of my custom post type. 通过使用插件“自定义固定链接”我可以加我想要的永久链接,所以我只需要添加一些用于该类别的所有我的新职位和我的自定义后类型的所有新职位。 But I am still searching for a solution which does that part automatically if somebody knows... 但是我仍然在寻找一种解决方案,如果有人知道的话,该解决方案会自动执行该操作。

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

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