One to many custom post relationships

There many ways to solve this kind or problem, and without more details about what it is you are trying to achieve, it is difficult to give you a precise answer. Keep in mind also that ACF is made to ease the creation and usage of custom posts/fields and not really a tool to build relationships between data constructs. You really ought to code your own data constructs in order to have full control over their relationships.

Here is a general approach that you can use,

  1. create a custom post type called calender_event for example.
  2. create another custom post type called event_session.
  3. create a meta-field for the first post type called calendar_event_sessions.
  4. Each time you create a a new post event_session assign it to an existing calender_event and store its post ID as an array into the field calendar_event_sessions. This also means that when a post is deleted you need to remove it from any calender_event.

Leave a Comment