Have a CPT nested under another CPT in URL structure

Hello,

I have 2 custom post types: Studios and Stages. Each studio location contains a few stages that can be rented. Using loopers I am able to display the right Stages on each Studio page. But right now the Stages do not have a parent-child relationship with their Studio.

My question is: how to restructure the URL so that the stage falls under the corresponding Studio (domain.com/studio-A/stage-A), instead of falling under the stages archive URL (domain.com/stages/stage-A)

That way each Stage would have a unique URL, even if there are 3 stages that share the same letter Stage A for example. Ideally it would go this way:

domain.com/studio-A/stage-A
domain.com/studio-A/stage-B
domain.com/studio-A/stage-C

domain.com/studio-B/stage-A
domain.com/studio-B/stage-B
domain.com/studio-B/stage-C

domain.com/studio-C/stage-A
domain.com/studio-C/stage-B
domain.com/studio-C/stage-C

Hoping this something you have a solution for!

Thanks in advance,
Emile

1 Like

Hi Emile,

Thanks for reaching out.
Nesting of the Custom Post Type is not possible, I would suggest you create a custom taxonomy and apply that to your custom post type to acheive the URL structure you are trying to acheive.
Please go through the following article which may help you on this.


Hope it helps.
Thanks

Hi @tristup,

Thanks for the quick reply! I looked into these.

Do you suggest I create a taxonomy for the Stages (child) or the Studios (parent)? My instinct tells me to set up the Studios as the “taxonomy” and leave the stages as the CPT. So each Stage (CPT) can be associated to one Studio (taxonomy).

Attached is a visual representation of the structure I am trying to achieve.

Thank you for your help!

Emile

I just spotted a mistake in the example permalinks at the bottom of the page.
Please refer to the updated graph attached here:

Hi Emile,

The custom permalink structure and the custom post type are beyond the scope of Theme Support. I would suggest you hire a developer who can assist you to do the customization or you can avail of our newly launched service called One, where we answer the questions beyond normal theme support.
You can also go through the following article and the plugin in the WordPress repository, which may help you on this.


Hope it helps.
Thanks

Thank you for your help, Tristup.
I just signed up to One as this is quite a specific request.

Cheers

Hi @emile,

Great! I see that my colleague was already answered your question in One services.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.