Hi. I am having an issues with Repeater sub-fields. ACF link object is not returning the right output for the href link.
Repeater fields:
Field label = Link to doc
Field name = link_to_doc
Field type = Repeater
Repeater sub-fields 1:
Field label = Link
Field name = link
Field type = Link
Repeater sub-fields 2:
Field label = Text of link
Field name = text_of_link
Field type = Text
This is the code which seems to be wrong:
Code:
`<?php if ($section[‘link_to_doc’]) : ?>
<?php foreach ($section[‘link_to_doc’] as $link) : ?>
<div>
” class=”btn-txt”>
<?= $link[‘text_of_link’] ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
Can anyone let me know what’s wrong with the code?