Home › Forums › General Issues › How to get field data from a group inside a group › Reply To: How to get field data from a group inside a group
<div class="war-front-form">
<?
php if( have_rows('warranty-member') ): //parent group field
while( have_rows('warranty-member') ): the_row();
// vars
$name = get_sub_field('warranty-name');
$birth = get_sub_field('warranty-birth');
$phone = get_sub_field('warranty-phone');
$email = get_sub_field('warranty-email');
?>
<div class="war-front-member">
<h1>고객정보</h1>
<ul>
<li><span>이름</span><p><?php echo $name ?></p></li>
<li><span>생년월일</span><p><?php echo $birth ?></p></li>
<li><span>연락처</span><p><?php echo $phone ?></p></li>
<li><span>이메일</span><p><?php echo $email ?></p></li>
<li>
<?php if( have_rows('warranty-adress-group') ): //child group field
while( have_rows('warranty-adress-group') ): the_row();
// vars
$postcode = get_sub_field('warranty-postcode');
$adress = get_sub_field('warranty-adress');
$adress2 = get_sub_field('warranty-adress-2');
?>
<span>주소</span>
<p><?php echo $postcode ?></p>
<p><?php echo $adress ?></p>
<p><?php echo $adress2 ?></p>
<?php endwhile; ?>
<?php endif; ?>
</li>
</ul>
</div>
<?php endwhile; ?>
<?php endif; ?>
this is my group in group source code
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.