Tell us what you are trying to do?
I have a Custom Post Type of Training Courses, and a Custom Post Type of Testimonials, linked by a One-to-Many relationship. On any training course page, at the bottom, I want to show testimonials that have been given for the course. I can make this work by creating a View Block on the Training Course Content Template, no problem.
However, if I explain the fields in CPT Testimonials, they are basically a quote (the testimonial), and who sent it in (name, company name). As there can be many testimonials from a single training class that has been run, it's repetitive and doesn't look very good for the view to list all quotes, followed by the same company name. What I would like to do is be able to loop through all quotes for the same company, and then, after the last one in the group, display the company name.
So NOT THIS:
Great Course!
ABC Inc
Wish I had done this sooner.
ABC Inc
I struggled a little but got there in the end thanks to the great tutor.
ABC Inc
BUT THIS:
Great Course!
Wish I had done this sooner.
I struggled a little but got there in the end thanks to the great tutor.
ABC Inc
In other words, I only want to mention the Company name after the last one in the group. Other groups may follow, as the training course is run repeatedly, and therefore there will be groups of testimonials from more companies.
Is there any documentation that you are following?
Read various threads and articles, but can't relate what I've read with working in the block editor
Is there a similar example that we can see?
No
What is the link to your site?
Here is a page where you can see how it is coming out - scroll to the bottom of the page, under the 3 coloured calls to action.
hidden link
This is a password-protected test site. Let me know how to pass you the credentials.
Thanks for your help.
Steve