Home › Forums › Add-ons › Repeater Field › Repeater not working › Reply To: Repeater not working
They are post objets, I just fixed those:
if( have_rows(‘cobertura’) ): ?>
<p class=”font-arial fs-13 hint-text”>País<br>
<?php while ( have_rows(‘cobertura’) ) : the_row();
$myposts = get_sub_field(‘pais’);
if( $myposts ): foreach( $myposts as $post_object):
echo get_the_title($post_object->ID);
endforeach;
endif;
echo “</p>”;
endwhile;
else :
if ($pais != ”) { ?><p class=”font-arial fs-13 hint-text”>País<br><?php echo $pais; ?></p><?php }
endif; ?>
Now I have another repeater “temas” located right next to “cobertura” from where I get “temas_generales” and “temas_específicos” both are post object subfields, I did copy & paste the code for “cobertura” and change only the names of the fields, but it returns the title of the custom post type (news), any idea?
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.