Separate Repeat fields

This topic contains 1 reply and 2 voices, and was last updated by Tareq Hasan 11 years, 7 months ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
April 11, 2013 at 6:59 pm 2051
Tareq Hasan Hello I do this code to show repeat fields <?php echo wpuf_meta_shortcode(array('name' => 'telefono')); ?> What can i do to separate fields one by one to show only first field Thanks
April 12, 2013 at 1:29 am 2061
Tareq Hasan Tareq Hasan

I would suggest you to get the meta value by $telefono = get_post_meta( $post->ID, ‘telefono’ ); and then run a foreach loop. Then separate the the field with explode( ‘, ‘, $field ) you’ll get an array.
[php]
$telefono = get_post_meta( $post-&gt;ID, ‘telefono’ );
foreach( $telefono as $t ) {
$value = explode( ‘, ‘, $t );
print_r( $value );
}
[/php]

Viewing 1 Posts - 1 through 1 (of 1 total)