Support

Account

Home Forums Add-ons Flexible Content Field Flexible Content – Map – functions.php Reply To: Flexible Content – Map – functions.php

  • Yes, Once you are already inside a loop on a repeater (a flex field is also a repeater) you no longer need to supply a post ID.

    
    if (have_rows('flex-field-name', $post_id)) {
      while (have_rows('flex-field-name', $post_id)) {
        the_row();
        // you no longer need to provide the post ID
        // nested repeater
        if (have_rows('locations')) {
          while (have_rows('locations')) {
            the_row();
            // etc....
          }
        }
      }
    }