Home › Forums › General Issues › User Field (Relational) › Reply To: User Field (Relational)
so, for example, here:
<?php
$users = get_sub_field('author');
echo get_avatar( get_the_author_meta( 'user_email' , $users['ID']), apply_filters( 'twentyeleven_author_bio_avatar_size', 120 ) );
?>
Once you have the user array you just need to use that array element wherever the WP function calls for the user ID. Or you can do this
$user_id = $users['ID'];
and then use that variable wherever you need to supply the user ID.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.