• Resolved TDR

    (@tdr)


    Between posts that is.

    I’ve got 4 custom post types:
    – Artist
    – Performance
    – Stage
    – Route

    Performance
    The main post type is Performance. (the main product)

    Artist
    The performance is done by an artist. The artist could have several different performances. (not just multiple times)

    Stage
    The performance takes place on a stage. The stage could have multiple Performances.

    Route
    There are a few routes based on a theme leading though several (not all) stages.

    ** What do I want? **
    I wish to create bidirectional relationships between the different (custom)posts.

    I’ll take stage as an example:
    As show in this https://www.dropbox.com/s/tksk20fvy4ipvvv/Screen%20Shot%202018-08-02%20at%2021.35.43.png?dl=0 example I wish to create a post(list) of all the performances on that stage.

    My setup:
    I work with WPbakery, CPT & ACF

    I briefly looked into eventplanner plugins, but they all seem to be basic and one layer of relationship.

    Anyone who could shed some light on my relationship problems?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Posts don’t normally relate to each other, except with hierarchical posts they have parents and children, but always of the same type. Relations are typically managed with taxonomies. Is there a particular reason why the post types other than performances need to be posts? Couldn’t they be taxonomies?

    Adding artist taxonomy terms to performance posts means you can get the artists for a particular performance or get performances for a particular artist. Same goes for stage and route. Artists could be indirectly related to stages through their performances, and so on.

    Relating posts to other post types can be accomplished with a bunch of custom coding, you would end up with a structure much like the taxonomy structure. You may as well use the taxonomy structure itself and not reinvent the wheel.

    Thread Starter TDR

    (@tdr)

    Hi @bcworkz, thanks for your reply!

    I’ve got my solution to work with Advanced Custom Fields – Relationship field. With this I was able to create many-to-many and bi-directional fields.
    https://www.advancedcustomfields.com/resources/relationship/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I need relationship advice’ is closed to new replies.