Home Forums Front-end Issues Can a Post Object relationship work both ways?


Can a Post Object relationship work both ways?

  • I have created a custom field with a Post Object on a custom post type (Whisky), so I can relate it to posts of another custom post type (Tasting Event). This works fine and I can list the related posts (Tasting Events) in the original post (Whisky). However, is it possible to query the relationship in the other direction? i.e. list the Tasting Event posts from the Whisky post? I suspect not very easily as I presume the related post data is stored as json against the original post, so would be a bit of a horrible query parsing json within the SQL behind the scenes.
    Best alternative I can think of at the moment is using a custom taxonomy to link the 2 things, but it’s a bit more of a faff from an admin point of view as the admins will have to maintain a list of Tasting Events as a taxonomy as well as creating Tasting Event posts.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.