Permalink URL connection between two custom types

We use latest WP 5.2, and the super plugins Advanced Custom Fields Pro (ACF Pro) and CPT UI. In our website taxonomy, we need to have events, within which we have talks and workshops.

Example structure:

Event 1
|__ Workshop A
|__ Workshop B

Event 2
|__ Workshop C
|__ Workshop D

We have therefore setup two custom post types: Events, and Workshops. We first create events. Then, when creating each workshop, we have a custom-field association with a related field and can thus create workshops within each event. In other words, each workshop is associated with a pre-created event. This works beautifully and ACF Pro is a stellar help.

However, the URLs created by WordPress follow the custom posts as if they’re unrelated:

/events/event-1
/events/event-2
/workshops/workshop-a
/workshops/workshop-b

What we’d like is to manifest the association in actual permalink URLs:

/event-1/workshop-a
/event-1/workshop-b
/event-2/workshop-c
/event-2/workshop-d

I found some questions on the site related to this, but they’re either too localized, or deal with the wp_query inside already working permalinks, or have 0 answers. Any ideas how to set this up in WordPress? Many thanks.

Read more here:: Permalink URL connection between two custom types

Leave a Reply

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