admin管理员组文章数量:1130349
I have two custom post types.
Destinations - destination custom post type has their posts and they are organized in hierarchical mode example:
- Malaga
- Food
- Gallery
- Rooms
- Marbella
- Food
- Gallery
- Rooms
- Malaga
Each of the destination post it was programmed to look as a page. Inside Rooms post (page) I can select other different custom post types from "Room" custom post type to be visible inside a Room page.
- Room - custom post type, have their details, price, description etc.
Now when I am opening one of the destination page and then I click on Room it will open my room page. URL will be something like:
"/rooms/room-name".
Now in room page I have all the room custom post types that I have selected.
Now my problem is that when I click on the rooms they will redirect me to custom post type URL example: "/room/room-name".
My question is how can I change the custom post type url, so when I click on room custom post type to not change the actual URL but just to add room title in URL example to be like:
"/malaga/rooms/room-name"
My problem is that destionation part is dynamic and I don't know how to do that ?
What changes do I need to do to be able to use custom post types in this way ?
I have two custom post types.
Destinations - destination custom post type has their posts and they are organized in hierarchical mode example:
- Malaga
- Food
- Gallery
- Rooms
- Marbella
- Food
- Gallery
- Rooms
- Malaga
Each of the destination post it was programmed to look as a page. Inside Rooms post (page) I can select other different custom post types from "Room" custom post type to be visible inside a Room page.
- Room - custom post type, have their details, price, description etc.
Now when I am opening one of the destination page and then I click on Room it will open my room page. URL will be something like:
"/rooms/room-name".
Now in room page I have all the room custom post types that I have selected.
Now my problem is that when I click on the rooms they will redirect me to custom post type URL example: "/room/room-name".
My question is how can I change the custom post type url, so when I click on room custom post type to not change the actual URL but just to add room title in URL example to be like:
"/malaga/rooms/room-name"
My problem is that destionation part is dynamic and I don't know how to do that ?
What changes do I need to do to be able to use custom post types in this way ?
本文标签: url rewritingWordPress custom post type url change
版权声明:本文标题:url rewriting - WordPress custom post type url change 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749141831a2322313.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论