Hi there,
I am trying to use a group field with 2 sub fields (an image and a WYSIWYG text box) but I am unable to get anything to display front-end. Tried both examples from documentation here.
Here’s a screen shot of my group:
Here’s my code:
<?php if( have_rows('meet_sherry') ): // check if there are buy links
echo '<h3>Meet Sherry</h3>';
while( have_rows('meet_sherry') ): the_row();
$aimage = get_sub_field('author_image'); //Get Cover ?>
<img src="<?php echo $aimage['url']; ?>" alt="<?php echo $aimage['alt']; ?>" />
<?php if ( get_sub_field('introduction_text') ):
echo the_sub_field('introduction_text');
endif;
endwhile; // ends affiliation repeater
endif; ?>
try with adding
$term = get_queried_object();
$aimage = get_sub_field('author_image',$term);
Thanks. I added this and had to put in a wp_reset_query (instead of reset post data) at the end of the previous call. Seems to be working now!