Code to Add Author Profile Fields - WPTRINITY

Code to Add Author Profile Fields

Do you want to add extra fields to your author profiles in WordPress?
You can easily do that by adding this code to your functions.php file:

function wpe_new_contactmethods( $contactmethods ) {
// Add Twitter
$contactmethods['twitter'] = 'Twitter';
//add Facebook
$contactmethods['facebook'] = 'Facebook';
 
return $contactmethods;
}
add_filter('user_contactmethods','wpe_new_contactmethods',10,1);

You can now display these fields in your author template like this:

<?php echo $curauth->twitter; ?>