Home › Forums › Add-ons › Repeater Field › 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 ?
The topic ‘Repeater don't show’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.