Title: [Plugin: Developer&#039;s Custom Fields] Echo user fields
Last modified: August 20, 2016

---

# [Plugin: Developer's Custom Fields] Echo user fields

 *  Anonymous User 8133435
 * (@anonymized-8133435)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-echo-user-fields/)
 * Hi there, I was wondering if you could tell me how to echo the information from
   user fields. I’ve added a few extra user fields and I want to display the values
   of those on the author page and next to posts the author made. Now I just know
   it must be in your documentation, but I’m just hopeless in figuring it out. Thanks
   for your time.
 * [http://wordpress.org/extend/plugins/developers-custom-fields/](http://wordpress.org/extend/plugins/developers-custom-fields/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Steve Taylor](https://wordpress.org/support/users/gyrus/)
 * (@gyrus)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-echo-user-fields/#post-2335182)
 * You should do something like this:
 * `<?php $my_user_fields = slt_cf_all_field_values( 'user', $user_id ); ?>`
 * Where `$user_id` has been set to the ID of the user you’re grabbing the custom
   fields for. On an author archive template, you can get the ID like this (see 
   [http://codex.wordpress.org/Author_Templates#Setting_Up_for_Author_Information](http://codex.wordpress.org/Author_Templates#Setting_Up_for_Author_Information)):
 *     ```
       <?php
       global $wp_query;
       $curauth = $wp_query->get_queried_object();
       $my_user_fields = slt_cf_all_field_values( 'user', $curauth->ID );
       ?>
       ```
   
 * `$my_user_fields` will then be an array of the values set by fields defined by
   the Developer’s Custom Fields plugin.
 * In theory you should be able to do this:
 * `<?php $my_user_fields = slt_cf_all_field_values( 'user' ); ?>`
 * However, looking at the code, I’ve done the default for the user ID wrong – it
   defaults using `wp_get_current_user()`, which returns the currently logged in
   user! For the next version of the plugin, I’ll make it so it tries to default
   to the ID of the author whose archive page is being displayed, and if not it’ll
   default to the ID of the currently logged in user.
 * For now, best to get the ID yourself and pass it explicitly.
 *  Thread Starter Anonymous User 8133435
 * (@anonymized-8133435)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-echo-user-fields/#post-2335191)
 * Again, thanks for the quick response! Ah that explains why I was seeing my own
   user information instead of the intended everywhere, haha. If I understand this
   well, this would make it difficult to create a list with information from all
   authors, unless I specify the ID for each author independently, right?
 *  Plugin Author [Steve Taylor](https://wordpress.org/support/users/gyrus/)
 * (@gyrus)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-echo-user-fields/#post-2335192)
 * Yes, just pass the ID explicitly to `slt_cf_field_value` or `slt_cf_all_field_values`–
   obviously if you’re looping through a list of authors, you’ll have that ID easily
   accessible. Not difficult at all 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Developer's Custom Fields] Echo user fields’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/developers-custom-fields.svg)
 * [Developer's Custom Fields](https://wordpress.org/plugins/developers-custom-fields/)
 * [Support Threads](https://wordpress.org/support/plugin/developers-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/developers-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/developers-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/developers-custom-fields/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Steve Taylor](https://wordpress.org/support/users/gyrus/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-echo-user-fields/#post-2335192)
 * Status: not resolved