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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.