How to get this URL structure for a custom post type in WordPress?

I’m going to have couple services, suburb and sub services for a WordPress website using custom post types.

I’m trying not to use 3rd-party plugins if possible (if there is a great one which can easily solve this problem then that’s fine).
I’m using a custom post type called “Service”.
I have 3 levels of posts (Services -> Suburb -> Sub Services).
Each level is going to have a different template.
Each post (services, suburb and sub-services) will have different contents.
URL structure I want to achieve is like below:

1st level: /service-name/city-name

2nd level: /service-name/suburb

3rd level: /sub-service-name/suburb

Example:

/lawn-care/texas

/lawn-care/greatwood

/lawn-mowing/greatwood

I will also have other services (14-15) like this:

/house-cleaning/another-state

/house-cleaning/suburb

/deep-cleaning/suburb

I’m open to any ideas like changing custom post type slug or using taxonomies. Any possible solution, greatly appreciated!

Read more here:: How to get this URL structure for a custom post type in WordPress?

Leave a Reply

Your email address will not be published. Required fields are marked *