I have two staff members on one article.
This is the code I'm using right now
[wpv-post-title item='@authors-blog-staff.parent']
But that only shows the first one.
How would I add the second?
Hello,
How do you setup the post type relationship "authors-blog-staff"?
I assume it is many-to-many relationship, so one "article" post can connect with multiple "staff members" posts, you can setup a post view to display related "staff members" posts, for example:
- Query "staff members" posts
- Filter by the post type relationship "authors-blog-staff"
See our document:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
Sorry I wasn't more clear.
I have a view set up using a bootstrap grid. It's showing all Custom Post Types called "Article" in descending order by date.
I have a many to many relationship set up between "Article" and "Staff"
I'm using this code in the loop :
<div class="category_tag">[wpv-post-taxonomy type="pertinent_tags"]</div>
<a href='[wpv-post-url]'>[wpv-post-featured-image size="large"]</a>
<h3>[wpv-post-link]</h3>
[wpv-post-excerpt]
<div class="author_date">[types field='staff_image' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='30' height='30' resize='crop' item='@authors-blog-staff.parent'][/types] <a href="[wpv-post-url item='@authors-blog-staff.parent']">[wpv-post-title item='@authors-blog-staff.parent']</a> - [wpv-post-date]</div>
It shows an author on every single article in the loop.
What it doesn't show is the second author (when and if there is one)
Is there someone in my time zone that can help with this?
In your case, it needs another child view, for example:
setup a post view "related-staff-posts":
- Query "staff members" posts
- Filter by the post type relationship "authors-blog-staff"
- display staff post information
Then put above view "related-staff-posts" shortcodes into your existed view's loop(showing all Custom Post Types called "Article" in descending order by date) .
Which timezone are you in? please let me know if you need assistance from other supporters.
Yes, I still need assistance. I'm having difficulty with the directions above. I'm in the US in New York time zone.
OK, I have assigned this ticket to our colleague, he is in US too.
Hello, I understand you have a View showing Articles and you need to show related Authors of each Article. Luo recommended creating a nested View of Authors, filtered by post relationship, where the parent post is set by the current post in the loop. If you're having difficult here, please show me some screenshots of each View in wp-admin so I can check your configurations.
Hello, thanks for getting back. I am going to stick with a one to many (staff to article) relationship for now.
Every time I go in and change the relationship to many to many, it breaks a lot of what I had already built.
And I'm finding I cannot go back to a one to many relationship afterward, which then means I have to re-migrate the site and start again.
I plan on putting this on a dev server soon, so perhaps I can reopen this when that is the case. I have another ticket to open in the meantime and I am closing this one.
My issue is resolved now. Thank you!