Displaying nested ACF fields in WordPress: How to show a sub-group's sub-field?

I'm stuck trying to show a nested field in WordPress using Advanced Custom Fields (ACF). I can display regular sub-fields fine, but I'm lost when it comes to sub-fields inside a sub-group.

My field structure looks like this:

- Program (Group)
  - Program Name (Text)
  - Program Info (Group)
    - Program Summary (Text)

I can show the Program Name like this:

```php
<?php
$program = get_field('program');
if ($program):
    echo '<h3>' . $program['program_name'] . '</h3>';
endif;

But how do I display the Program Summary? It’s inside the Program Info group. Is there a special way to access these nested fields? Any help would be great!

yo Echo_Vibrant, ACF can be tricky with nested stuff. try this:

if ($program && isset($program['program_info']['program_summary'])) {
    echo $program['program_info']['program_summary'];
}

this checks if the field exists before echoing. what kinda site u workin on? ACF’s pretty sweet for custom layouts!

hey there! i’ve messed with nested ACF fields before. have u tried something like this:

echo $program['program_info']['program_summary'];

it’s kinda like drilling down thru the groups. curious to know if that works for u? what other cool stuff r u building with ACF?

To access nested ACF fields, you need to follow the hierarchy of your field structure. In your case, to display the Program Summary, you would use:

<?php
$program = get_field('program');
if ($program && isset($program['program_info']['program_summary'])):
    echo '<p>' . $program['program_info']['program_summary'] . '</p>';
endif;

This approach ensures you’re checking for the existence of each level before attempting to access it, preventing potential errors. Remember to adjust field names if they differ in your setup. Additionally, consider using the get_sub_field() function when working within ACF loops for more complex structures.