admin管理员组文章数量:1122832
I have a custom post type (created with ACF), called shops.
Each shop has data for example about working hours, which are separated in each custom field (Monday, Tuesday, wednesday etc.).
I have all the info on single page of each shop, for example on mysite/shop/shop-name/, and my question is, how can I create a subpage for each shop which will have an url like this: mysite/shop/shop-name/working-hours/ on which I will put the data about working hours?
I've looked at hierarchical Custom Post Types but didn't understand if that is what I am looking for.
Thank you
I have a custom post type (created with ACF), called shops.
Each shop has data for example about working hours, which are separated in each custom field (Monday, Tuesday, wednesday etc.).
I have all the info on single page of each shop, for example on mysite.com/shop/shop-name/, and my question is, how can I create a subpage for each shop which will have an url like this: mysite.com/shop/shop-name/working-hours/ on which I will put the data about working hours?
I've looked at hierarchical Custom Post Types but didn't understand if that is what I am looking for.
Thank you
Share Improve this question asked Jul 19, 2024 at 15:02 pomaaapomaaa 1013 bronze badges1 Answer
Reset to default 0Yes, setting the hierarchical
option to true
when you register the custom post type will mean each of your "shop pages" can have child "shop pages." So you could have
example.com/shop/shop-name/
example.com/shop/shop-name/hours/
example.com/shop/shop-name/contact/
etc.
I believe ACF has a simple toggle to enable the hierarchical
option. If you were registering it in code, you would just set that to true
.
本文标签: Creating subpages for each custom post type
版权声明:本文标题:Creating subpages for each custom post type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300506a1930840.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论