Skip Navigation

[Resolved] Create relationship between parent posts

This thread is resolved. Here is a description of the problem and solution.

Problem: I have two post types in a parent / child post relationship. I would like to relate a parent post to another parent post, but I am unable to use post relationships or post reference fields in the same post type. How can I link these parent posts?

Solution: The simplest way is to create a custom taxonomy, and apply the same taxonomy terms to related parent posts.

Relevant Documentation: https://toolset.com/documentation/user-guides/create-custom-taxonomies/

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by laneV 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1084045

I have parent posts, each with a few child posts. That works well. Each of my parent pages is for a single location. There can be instances where one person/company own more than one location. I'd like to be able to show on each of those associated locations (ie parent posts) that there is a relationship to the other locations. Does this make sense? In other words, if I have a directory of restaurants and each restaurant is a parent post, and someone owns 3 restaurants I'd like to be able to list on each of those 3 parent posts they are related to the others by person/company owning them. I can't create a toolset relationship between the parent posts and I can't add post references within the same post type. How can I accomplish this?

#1084069

Hi, a simple way to do this is to use a custom taxonomy. Create a custom taxonomy called "Owners" and associate that custom taxonomy with these post types. Add a term that represents each Owner. Then assign that taxonomy term to all the restaurants or locations owned by the same owner. On the single post template, you can add a View of the same post type filtered by the owner taxonomy, where the term is set by the current page. This will give you a list of locations owned by the same owner.

#1085782

Thank you Christian! That worked perfectly!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.