Support

Account

Home Forums Front-end Issues How do I output a sub field of a sub group?

Unread

How do I output a sub field of a sub group?

  • Greetings!

    I can’t figure out how to output the sub field of a sub group.

    This is the structure:

    Course (GROUP Field Type)
    –Course Title (TEXT Field Type)
    –Course Details (GROUP Field Type)
    —-Course Info (TEXT Field Type)
    —-Course Duration (TEXT Field Type)

    Along with an if, this is how I output the Course Title as it is a sub field:

    <?php $theCourse = get_field('course'); ?>
    <?php if ( $theCourse ) : ?>
    <h2 class="course-title"><?php echo $theCourse['course_title']; ?></h2>
    <?php endif; ?>

    My problem is that I can’t figure out how to output the Course Info/Duration as they are sub fields of a sub field. Even just for the Info for example, as a div…how is it done? With a combination of variables?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.