Home › Forums › Add-ons › Repeater Field › Need your help about have_rows function › Reply To: Need your help about have_rows function
All ACF functions will load and save data to a $post. This is an important concept to understand.
The shortcode will work on your single template, buecause WP understands there that all the info on that page is related to a single $post, and ACF can load / save data to that $post.
On your ‘archive’ page, It is most likely that ACF does not know which $post to load the data from.
Is the ‘archive’ page looping through the ‘tour’ posts?
For each post, is it using the
the_content() function to output text?
the_content() is not being used within the loop, the shortcode will never be called. You can remove the ACF code from your shortcode function and simply try to output some data about the $post, thus removing the potential issue of ACF.
Once you can confirm that the shortcode is running in the correct template, and that the $post data is correct, you can add back in the ACF code.
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.