Home Forums Add-ons Repeater Field Issue with While Loop and Fragment Cache Reply To: Issue with While Loop and Fragment Cache

  • Looking at your code, my first question is, what is the value of $page_id. It’s not defined. On this line have_rows('tab_content', $page_id) ) since it is not defined then ACF is assuming the current post ID, whatever that might be.

    Second part get_sub_field('tab_image', $page_id); for sub fields you do not need to specify the post ID. This second parameter is whether or not to format the value. Since $page_id is undefined at this point, or null, that equals false and this is causing ACF to return the unformatted value of the sub field, in this case the attachment ID.