Problem: I am trying to use the Forms API, but I'm having trouble getting the value of a custom field and the selected post parent.
Solution: Use the 'wpcf-' prefix to access the value of a Types custom field in the Form, and use the parent field name to access the ID of the parent post.
Problem: I would like to display a list of a repeatable field group (RFG) in a post template. The RFG belongs to a related post of the post being displayed in the post template.
Solution:
- Create a View of the RFG, filtered by post relationship, where the parent Race Result PDF is set by the current post in the loop. In the loop of this View, output your custom field information.
- Create a View to display Race Result PDFs only. It should have a Post Relationship Query Filter, where the parent Race Event is the post where this View is displayed.
- Place the View of Race Result PDFs in the template for Race Events. This is the only View that should be placed in the Race Results section.
- In the Loop of the View of Race Result PDFs, place your View of the RFG. You can also output the title of the Race Result PDF if necessary, or any other information from the Race Result PDF that will help you break up the display of your data.
Solution:
From the post edit screen of one end of the relationship if you add a related post then a dialog appears where you can set the relationship field values.
For existing connections use the Quick Edit link which opens the same dialog.