I have a similar problem as shown here: https://support.advancedcustomfields.com/forums/topic/option-field-value-not-loading-on-archive-page/ however I am using repeater fields in a shortcode, here is my code:
function dev_logos_func( $atts ){
$devLogos = '<div id="logos">';
while ( have_rows('development_logos','options') ) : the_row();
$devLogos .= '<a href="'.get_sub_field('dev_url','options').'" target="_blank">'.get_sub_field('dev_name','options').'</a><div class="logosTxt">'.get_sub_field('dev_text','options').'</div>';
endwhile;
$devLogos .= '</div>';
return $devLogos;
}
add_shortcode( 'dev_logos', 'dev_logos_func' );
They show on every page except archive, and also categories.
Some of my other fields where the same such as a image field however I was able to by pass that by doing a conditional statement like this:
if (is_archive()) {
$logoUrl = wp_get_attachment_url( get_field('logo', 'options') );
} else {
$logoUrl = get_field('logo', 'options');
}
However I am unsure what I can do for my repeater fields considering they are just text, url and textarea. I did find this: https://www.advancedcustomfields.com/resources/value-loading-posts-page/ however do not know how I can apply it to my issue.
Any help would be greatly appreciated.