I’ve made two custom post types, one of which (style-section) is the parent of the other (style-rule), and has a relationship field that connects the two. On the parent posts I want to loop through the related child content.
If I use an actual post ID (206 in this example, below) this works. But I want to dynamically get the post ID of the current post, and I haven’t managed to find a way to do this.
<Loop type=style-rule custom_field="style-section" custom_field_value="206">
<h2><Field title /></h2>
<div><Field content /></div>
</Loop>