Skip Navigation

[Resolved] View for relationship with link to related posts

This support ticket is created 2 years, 6 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2369151

Hi,
I'm created two CPT, one for consultants and one for company. They're having a one-to-many relationship - one company - many consultants.
Now I want to create a view showing all companies. When clicking on a company, I want to open a page with only the consultants of this company. I've read through many solutions on your site, but somehow I cannot find the right one.
Do you have a hint for me?
Best regards
Alex

#2369199

Hi,

Thank you for contacting us and I'd be happy to assist.

You can achieve this using two separate views:

1. The first view will show all "company" posts and you can place it on the page where you'd like to list all the companies.
( ref: https://toolset.com/lesson-placement/lesson-placements-1621261-1622283/ )

On clicking the link title of the individual "company", the user will be taken to its single "company" post page.

2. On the single "company" post page, you can show another view, that shows all the "consultant" posts, related to the current "company" post.

Here is a guide on showing the related posts, using a view:
https://toolset.com/lesson-placement/lesson-placements-1729031-1730449/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar