Home Forums Plugin Support WP User Frontend Pro Separate Repeat fields

This topic is: not resolved

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Tareq Hasan 6 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2051

    ivaxtobac
    Participant
    Post count: 35

    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

    #2061

    Tareq Hasan
    Keymaster
    Post count: 2831

    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->ID, ‘telefono' );
    foreach( $telefono as $t ) {
    $value = explode( ‘, ‘, $t );
    print_r( $value );
    }
    [/php]

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Separate Repeat fields’ is closed to new replies.