Support

Account

Home Forums ACF PRO issues displaying 'Relationship user field'

Solving

issues displaying 'Relationship user field'

  • Hello,
    First, thank you for this plug-in which gives the possibility to build a powerful WordPress website.

    Unfortunately, I met some troubles for displaying Relational fields (User fields).

    I created a fields group assign to a specific page (home page).
    The field type is “users”, with multiple choices are allowed.

    1/ So, my purpose is to display in my page a list of SOME users and their metadata:
    – classical data : description, name
    – Custom fields : avatar

    I tried to make it work with the resources post “Get values from a user” & “Repeater” but still not working. I didn’t find any information about the way “the relations fields user type” works in details, which value is retrieved for example ?

    Thanks for your help

  • Have you found a solution?

  • Hello @elle ,
    Sorry we never found the solution.
    We manage with a system based on a custom post
    Good luck

  • Hi @virtualexpo and @elle

    User field type returns arrays with user information in it. You can always use print_r() or var_dump() to show the data. This page should give you more idea about it: http://www.advancedcustomfields.com/resources/debug/. So, you can use this code to see the returned data:

    echo "<pre>";
    print_r(get_field("user_field_name"));
    echo "</pre>";

    To get the custom field from the user, please take a look at this page: http://www.advancedcustomfields.com/resources/how-to-get-values-from-a-user/.

    I hope this helps.

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

The topic ‘issues displaying 'Relationship user field'’ is closed to new replies.