Support

Account

Home Forums Add-ons Repeater Field Need your help about have_rows function Reply To: Need your help about have_rows function

  • Hi @dagiac

    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?
    If 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.

    Thanks
    E