Support

Account

Home Forums Add-ons Repeater Field get_post_meta for a repeater field Reply To: get_post_meta for a repeater field

  • John, your solution is right and worked for me, but there is a typo in the for(…) parameters. Since this post is the first to come up in Google for the issue I hope this helps some people:

    $repeater_value = get_post_meta($post_id, 'repeater_field_name', true);
    if ($repeater_value) {
      for ($i=0; $i<$repeater_value;/*<-fixed*/ $i++) {
        $meta_key = 'repeater_field_name_'.$i.'_sub_field_name';
        $sub_field_value = get_post_meta($post_id, $meta_key, true);
      }
    }