Support

Account

Home Forums ACF PRO Permalink URL connection between two custom types

Solving

Permalink URL connection between two custom types

  • Hello,

    I use ACF Pro and CPT UI. We have overall 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. 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 URLs:

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

    Any ideas how to do this? Many thanks

  • Thank you John. That seems to be code I’d enter in my theme (in functions.php), which is a sad way to set up the base structure of a website. A classic WP issue.

    I’d prefer to do this using plugins, so this core functionality doesn’t become theme-dependent. Can’t CPT UI and ACF Pro manage this simple things needed in any website other than a blog? Welcome other recommendations for a plugin. Thanks!

  • I don’t know of any plugins that will alter the permalink structure in this way. ACF is built to manage custom fields and doesn’t do anything at all about managing post types. CPTUI is built to let you define post types but not the relationships between them. Even plugins that I know of that let you manage relationship between post types do not alter the permalink structure in the way you’re looking for. Actually, there are been a few that have attempted this, but I’ve seen these come and go and they have never been reliable enough to depend on for the long hall or they have limitations that can cause a site to break if not used within those limitations.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.