Support

Account

Home Forums Add-ons Repeater Field Repeater don't show

Solving

Repeater don't show

  • Hello

    I’ve got an issue with repeater field.

    		
    		if( have_rows('elementalaune') ):
    
    				while ( have_rows('elementalaune') ) : the_row();
    					get_sub_field('image');
    					get_sub_field('texte');
    				endwhile;
    		else :
    				echo "Nothing here";
    		endif;
    

    This only echo “Nothing here”.
    It’s like my repeater is empty but it is not, as you can see on the uploaded picture.

  • Hi @tpodgro

    Is it possible that you are calling this code outside the posts() loop?
    If so, you will need to assign a post id as the second parameter on the have_rows() function like so:

    
    $post_id = '123';
    if( have_rows('elementalaune',$post_id) ):
    
    				while ( have_rows('elementalaune',$post_id) ) : the_row();
    					get_sub_field('image');
    					get_sub_field('texte');
    				endwhile;
    		else :
    				echo "Nothing here";
    		endif;
  • Hello, still not working.

    I’m in the main Shop page of woocommerce.

  • I tried with page id but change nothing.

    `$post_id = ’63’;

    if( have_rows(‘elementalaune’ , $post_id) ):
    while ( have_rows(‘elementalaune’, $post_id) ) : the_row();
    the_sub_field(‘image’);
    the_sub_field(‘texte’);
    endwhile;
    else :
    echo “Nothing here”;
    endif; `

  • Hi @tpodgro

    Please open a new ticket at https://www.advancedcustomfields.com/contact/ and share some temporary admin access so that the team can check this issue for you.

  • I am having the issue with the repeater field but don’t know to solve this error , any suggestions ?

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

The topic ‘Repeater don't show’ is closed to new replies.