Home › Forums › Add-ons › Flexible Content Field › Possible to get excerpt from sub_field? › Reply To: Possible to get excerpt from sub_field?
Not sure what I was thinking when I commented the last time. When you your using a sub field you always need to create a loop for the parent field.
if (have_rows('parent_field')) {
while(have_rows('parent_field')) {
the_row();
$text = get_sub_field('sub_field_name');
}
}
The details of what row and sub field you’ll need to work out for yourself, but you cannot use get_sub_field()
without creating a loop.
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.