Home › Forums › Add-ons › Repeater Field › Post object field inside repeater field › Reply To: Post object field inside repeater field
Yes, I finally figured out how to show the name! I’ve watched again Mr.Digitals Tutorials on YouTube, simplified your solution, made some trial and errors and finally it works. The code looks like this now:
<?php
if( have_rows('translation_translator') ):
while ( have_rows('translation_translator') ) : the_row(); ?>
<?php
$language = get_sub_field('translator_language');
?>
<div class="col-2">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/img/flags-iso/<?php echo $language->slug; ?>.png" title="<?php echo $language->name; ?>"> <?php echo $language->name; ?>
</div>
<div class="col-5">
<?php
$translator = get_sub_field('translator_name');
echo $translator->translator_first_name." ";
echo $translator->translator_last_name;
?>
</div>
<div class="col-md-5">
<?php $payment_method = get_sub_field('translator_payment_method');
echo $payment_method;
?>
</div>
<?php
endwhile;
endif;
?>
In the end, it was much simpler than expected. Just putting the sub_field in a variable and the access it.
$translator = get_sub_field('translator_name');
echo $translator->translator_first_name." ";
echo $translator->translator_last_name;
But there are still a few challenges open. Let’s see how it works …
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.