Nothing complicated: Just paste the following code into your function.php file. Edit lines 4 and 5 according to your needs.
add_filter('user_contactmethods', 'my_user_contactmethods');
function my_user_contactmethods($user_contactmethods){
$user_contactmethods['twitter'] = 'Twitter Username';
$user_contactmethods['facebook'] = 'Facebook Username';
return $user_contactmethods;
}
Hungry for code snippets? I just opened a snippet library on CatsWhoCode, which include lots of WordPress snippets. Have a look, and don't hesitate to submit yours!
Thanks to TutsPlus for the cool tip!
3 Responses
Thanks for the gr8 Tip. I am going to use it in my upcoming theme.
Thanks
Hey,
This really is a great tip, did this just a few days ago, lot of people would find this extremely useful…
I have a little question. I want to add a “Contact Number” field in the registration page as well as in the user profile page. Could anyone give a suggestion as to how to do it. I have already used Cimy Extra User Field plugin, looking for something else though!!
How would you display the new contact methods in your theme? I am trying to improve the author template and Twitter and Facebook contact details will be a nice addition.
Trackbacks: