Just in case anyone (just like me) comes across this thread, you can extend this to show custom fields.
Add this to your theme's functions.php
:
// Extend user profile
// CUSTOM USER PROFILE FIELDS
function my_custom_userfields( $contactmethods ) {
// ADD CONTACT CUSTOM FIELDS
$contactmethods['contact_phone_office'] = 'Office Phone';
$contactmethods['contact_phone_mobile'] = 'Mobile Phone';
// ADD ADDRESS CUSTOM FIELDS
$contactmethods['address_line_1'] = 'Address Line 1';
$contactmethods['address_line_2'] = 'Address Line 2 (optional)';
$contactmethods['address_city'] = 'City';
$contactmethods['address_state'] = 'State';
$contactmethods['address_postcode'] = 'Postcode';
// ADD SOCIAL CUSTOM FIELDS
$contactmethods['contact_twitter'] = 'Twitter';
$contactmethods['contact_facebook'] = 'Facebook';
$contactmethods['contact_linkedin'] = 'LinkedIn';
return $contactmethods;
}
add_filter('user_contactmethods','my_custom_userfields',10,1);
then just add whatever fields you want to your foreach
call, like:
echo '<li>'. get_avatar($user->ID, 120) .'<br />'. $user->display_name .'<br /><a href="mailto:'. $user->user_email .'">'. $user->user_email .'</a><br />'. get_user_meta($user->ID, 'description', true) .'<br />'. get_user_meta($user->ID, 'contact_twitter', true) .' - '. get_user_meta($user->ID, 'contact_facebook', true) .' - '. get_user_meta($user->ID, 'contact_linkedin', true) .'</li>';
I hope this is ok to post here. It's slightly off topic, but hopefully it helps (if not mods, please remove).