Support

Account

Home Forums Front-end Issues Unable to Display Group Fields on Front End

Solved

Unable to Display Group Fields on Front End

  • 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:
    Group settings

    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!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.