Εισάγουμε την παρακάτω συνάρτηση στο functions.php. Έτσι θα προσθέσουμε τέσσερα πεδία URL για Facebook, Twitter, Google Plus και Ιδιότητα.
function tcp_extra_fields_author($profile_fields) {
$profile_fields['twitter'] = 'Twitter URL';
$profile_fields['facebook'] = 'Facebook URL';
$profile_fields['gplus'] = 'Google+ URL';
$profile_fields['idiot'] = 'Ιδιότητα';
return $profile_fields;
}
add_filter('user_contactmethods', 'tcp_extra_fields_author');
Για να καλέσουμε καθένα από αυτά τα πεδία στο θέμα μας χρησιμοποιούμε τα παρακάτω.
the_author_meta('facebook');
the_author_meta('twitter');
the_author_meta('gplus');
the_author_meta('idiot');