Support

Account

Home Forums Add-ons Repeater Field Liveticker (take result from first row of event repeater field) Reply To: Liveticker (take result from first row of event repeater field)

  • Can you not simply use the first row of the repeater:

    <?php
     
    $rows = get_field('repeater_field_name' ); // get all the rows
    $first_row = $rows[0]; // get the first row
    $first_row_image = $first_row['sub_field_name' ]; // get the sub field value 
     
    // Note
    // $first_row_image = 123 (image ID)
     
    $image = wp_get_attachment_image_src( $first_row_image, 'full' );
    // url = $image[0];
    // width = $image[1];
    // height = $image[2];
    ?>
    <img src="<?php echo $image[0]; ?>" />

    Taken from here: Repeater Documentation