Thursday, November 28, 2013

Add Author Profile Fields

If you want to create a more versatile author page, then you would need to add additional fields to the author profile. The code below will show you how to add additional twitter and facebook fields, but you can use it to add any other field that you like.


function my_new_contactmethods( $contactmethods )

// Add Twitter

$contactmethods['twitter'] = ‘Twitter’;

//add Facebook

$contactmethods['facebook'] = ‘Facebook’;


return $contactmethods;


add_filter(‘user_contactmethods’,'my_new_contactmethods’,10,1);


You can then call the fields in your author.php template by adding the following code:


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



Add Author Profile Fields

No comments:

Post a Comment

Please mention your comments.......