Home Forums General Issues have_rows and the_sub_field not working together?


have_rows and the_sub_field not working together?

    • skycube

    • January 10, 2019 at 10:25 pm

    I’m trying to get this working following the documentation but it still doesn’t work. Ay suggestions?

    if (get_field('departures', get_the_ID())) {
            while( have_rows('departures') ): the_row();
                    // NOT WORKING
                    echo the_sub_field('departure_date');
                    // WORKING
                    $a = the_row();
                    echo $a['departure_date'];

    Example data:

  • do not use echo when using the_… functions

    instead of echo the_sub_field('departure_date');

    use the_sub_field('departure_date');

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.