Support

Account

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

Solving

Repeater don't show

    • tpodgro

    • July 18, 2019 at 10:02 am

    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.

    • James

    • July 18, 2019 at 9:05 pm

    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;
    • tpodgro

    • July 18, 2019 at 10:29 pm

    Hello, still not working.

    I’m in the main Shop page of woocommerce.

    • tpodgro

    • July 18, 2019 at 10:47 pm

    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; `

    • James

    • July 21, 2019 at 3:16 am

    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)

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.