I have a custom post type. This custom post type has a repeating image field associated with it.
I use the following code to display the image in the archive.php template.
<?php if( have_rows('ges_case_study') ): while ( have_rows('ges_case_study') ) : the_row(); ?>
<img src="<?php the_sub_field('case_study_img');?>" alt="Global Energy Systems - Case Studies" />
<?php break; //Using break here because I only want to display the first image of the repeating field ?>
else : // no rows found ?>
<?php endif; ?>
This displays the first image added in the repeating field section. When I display the single-custom-post-type.php i display them all.
Everything works perfectly.
The problem is in my category.php template.
In my category template I use the same code, but no image is displaying.