Home › Forums › Add-ons › Flexible Content Field › Flexible Field within Flexible Field ? › Reply To: Flexible Field within Flexible Field ?
Thanks Elliot! Works like charm! 🙂
EDIT
BTW. I managed to create flexible field inside flexible in dashboard. Now when I’m trying to return value of this fields in front end.But its not returning value of sub flexible fields.
I’m using following is code.
<?php
while (has_sub_field("main_field")):
?>;
<?php
if (get_row_layout() == "layout_1"):
?>
<div>
<php the_sub_field("textarea"); ?>
</div>
<?php
endif;
?>
<?php
if (get_row_layout() == "layout_2"):
?>
<?php
if (get_sub_field("main_2")):
?>
<?php
if (get_row_layout() == "layout_2a"):
?>
<div>
<?php
the_sub_field("text_field");
?>
</div>
<?php
elseif (get_row_layout() == "layout_2b"):
?>
<img src="<?php
the_sub_field('image_field');
?>" class="alignnone size-full" />
<?php
endif;
endif;
endif;
?>
<?php
endwhile;
?>
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.