Support

Account

Home Forums Add-ons Repeater Field Using get_post_meta as Fallback on Repeaters Reply To: Using get_post_meta as Fallback on Repeaters

  • tried to this using

    $rows = get_post_meta( 348, 'testimonials', false ); // get number of rows (8 but in a array)
    $row_count = $rows[0]; //get row number out of array (8)
    echo $row_count--; // because first row start with 0 not 1 subtract one from row number (8-1 =7)
    //now you could use $row_count to get last row (7)
    $lastrow =  'testimonials_'.$row_count.'_testimonial'; //you need to replace echo by a variable and use that
    
    echo $lastrow;

    What i get front end is
    8testimonials_7_testimonial