Home Forums General Issues Echo the selected User: Relationship User Field


Echo the selected User: Relationship User Field

  • Hi there. I’m attempting to use the Relationship User field, so that my admins can select a user to echo on the frontend.

    Right now, as I read your documentation, it is only good for querying posts/objects but when I simply put “<?php the_field(‘affiliate_name’); ?>”

    It echos the following ”

    “50, Matt, Blauer, mattsusername1, mattsusername1, Matt Blauer, [email protected], , 2014-09-24 20:01:58, , ”

    All I want it to echo is “Matt Blauer”

    How can this be achieved? Thanks.

  • Nevermind, solved this myself. In case anyone wants to know:

    <?php $agent = get_post_meta( $post->ID, ‘affiliate_name’, true ); $user_info = get_userdata($agent); echo $user_info->display_name;?>

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

You must be logged in to reply to this topic.