How to Add or Remove contact fields WordPress

Add this lines to your functions.php

Add or remove the fields you want using the example below:

function extra_contact_info($contactmethods) {
    unset($contactmethods['aim']);
    unset($contactmethods['yim']);
    unset($contactmethods['jabber']);
    $contactmethods['facebook'] = 'Facebook';
    $contactmethods['twitter'] = 'Twitter';

    return $contactmethods;
}
add_filter('user_contactmethods', 'extra_contact_info');Code language: PHP (php)

Get the fields in the Theme

You can use:

<a href="<?php the_author_meta('facebook', $current_author->ID); ?>"></a>Code language: HTML, XML (xml)

Leave a Reply

Your email address will not be published. Required fields are marked *