Problem:
The structure ist as follows:
A. Events / bands
- Each location can have one or multiple events.
- Each band can have one or multiple events.
- These post type are connected via an intermediary post type "appearances" (Child of Events and Bands)
B. Bands / artists
- Each band with some text can have multiple artists.
- Each artist with some photo and text can be in multiple bands
- These post type are connected via an intermediary post type "membership" (Child of Events and Bands)
Now I would like to be able to display on a same page fields from the event post type and - and thats the hard part - fields from the artist post type: I would like to be able to print a page that contains the field from the event (Date, time, location), fields from the band (band name) and fields from the artist (each artists bio and photo). Since artists have no direct connection to events, because the band is the direct connection, I cannot figure out how to do this.
Solution:
I assume we are talking about below case:
1) Parent post types "events" and "bands"
Child post type "appearances"
2) Parent post type "bands" and "artists"
Child post type "membership"
And you are going to achieve this:
In a single "artist" post, display the information of related "event" posts
This is possible, I suggest you try with a nested view
1) Parent view list "membership" posts, filer by "Post relationship filter":
Select posts that are children of the Post where this View is shown.
2) In the view's loop, you will be able to display those related "bands" posts, for example you can get the "band" post ID with shortcode [wpv-post-id id="$bands"], display content template of steps 3) and specific id attribute, for example:
[wpv-post-body view_template="band-post-info" id="[wpv-post-id id="$bands"]"]
3) Create a content template "band-post-info", display the view of step 4)
4) Create a view, list "appearances" posts, filer by "Post relationship filter":
Select posts that are children of the Post where this View is shown.
And display the custom fields of "events" posts
Relevant Documentation:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/
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/Hong_Kong (GMT+08:00)
This topic contains 2 replies, has 2 voices.
Last updated by 7 years, 2 months ago.
Assisted by: Luo Yang.