I’m racking my brain trying to think why this isn’t working. Seems to be right to me but I must be missing something.
<?php
if( have_rows('cta_box') ):
while( have_rows('cta_box') ) : the_row();
echo get_sub_field('cta_header');
echo get_sub_field('cta_content');
endwhile;
endif;
?>
Am I doing something dumb?
Thanks
3
Answers
Here is the code that got it working. Can someone explain? Is the code above this ACF effecting what is returned?
It’s a group field, not repeater. This’d help.
So in your case you’d use it like this.
your code is proper, i think the issue is where you want to display like in the specific template or any where in the page, you just need to assign with the template or page or post whatever its will display.