Jak přidat vlastní pole do uživatelského profilu a zobrazit je na stránce
„This technique“:http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields will allow you to easily add new user profile fields that your blog’s users can use to input more information about themselves. In this tutorial, I’ll show you how to add an input box for a Twitter username and how to display it on your site.
In „this article“:http://www.wpbeginner.com/wp-tutorials/how-to-display-an-author-list-with-avatars-in-wordpress-contributors-page/ we will show you how you can create a contributors page which will display a list of authors with avatars or userphoto and any other information that you like.
The user profile of WordPress can be fairly easily adapted to add your own values. So you can add the necessary *custom fields* according to your requirements. „Here is“:http://wpengineer.com/2173/custom-fields-wordpress-user-profile/ how you do it.
Most free themes do not have a custom ***author.php*** file, WordPress automatically callback to ***archive.php*** or ***index.php*** when someone views the author profile page. The problem with that is that it will only list all the posts written by the author, and it provides no personal information about the author. It is recommended that you copy your ***archive.php*** and save it as ***author.php*** and modify it.
To get user’s (author’s) data from his/her profile, use „get_userdata function“:http://codex.wordpress.org/Function_Reference/get_userdata:
/—code php
first_name;
$last_name = $user_info->last_name;
$email = $user_info->user_email;
$description = $user_info->description;
$roles = $user_info->roles;
$username = $user_info->user_login;
?>
\—
obdobně funkce „get user by“:http://codex.wordpress.org/Function_Reference/get_user_by.