Home › Forums › Add-ons › Repeater Field › User Field In A Repeater › Reply To: User Field In A Repeater
I did actually manage to get this working, for displaying the display_name at least. The final code I used was:
<span class="staff-note-label">Note Added By:</span>
<?php
$user = get_sub_field("staff_member");
if( $user ): ?>
<span class="staff-note-name"><a href="<?php echo $user['user_url']; ?>"><?php echo $user['display_name']; ?></a></span>
<?php endif; ?>
I’m unable to get the url to the User’s profile though. The url is showing as the current post url. I’m sure that user_url is the right meta and I noticed there’s code for the user_url in the multiple selected users example at:
https://www.advancedcustomfields.com/resources/user/
But I tried it with a multi select user field as well and used the second example code and the link is still for the current post and not the user profile url. How can I get the link for the user’s profile in this context?
Thanks.
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.