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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

Yes, 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