Hello Reunei,
Thanks for the response…!
I have been using Global blocks as well as the dynamic content feature and integration of single data fields has never been an issue in cornerstone. It works flawlessly.
However, the problem is looping through data fields of repeater and flexible data content from the ACF forms. It can not be done without using ‘while’ and ‘if’ conditions. is there any way to implement this logic for a specific type of post? for example, particular sections of portfolio posts.
If it can be done, where do the codes go? and how do I target them? Can it be done by adding some advanced custom coding to the child theme functions or it has to be added into the post type somewhere?
Something like this maybe? (Code taken from here)
<?php if( have_rows('repeater_field_name') ): ?>
<ul>
<?php while( have_rows('repeater_field_name') ): the_row(); ?>
<li>sub_field_1 = <?php the_sub_field('sub_field_1'); ?>, sub_field_2 = <?php the_sub_field('sub_field_2'); ?>, etc</li>
<?php
$sub_field_3 = get_sub_field('sub_field_3');
// do something with $sub_field_3
?>
<?php endwhile; ?>
</ul>
<?php endif; ?>
But I’m not sure where and how. Some support will be great here.
Thanks