Support

Account

Home Forums Add-ons Flexible Content Field Flexible – Add code to last row entry Reply To: Flexible – Add code to last row entry

  • I was able to solve this by finding the total amount of rows in your field by using get_field_object.

    In your code, after if( have_rows('cm_content') ): try this:

    $field_object = get_field_object('cm_content');
    $total_rows = count($field_object['value']);
    

    Then you can test for it with an if statement:

    if($counter == $total_rows ){
    // this is the last one!
    }
    

    Cheers,

    Andre