Skip to content
Advertisement

How to display extra text field on WordPress author page

I want to display an extra text field on the author page which I can fill in the respective user profile when I logged in. Additionally it would be great if the textfield has a WYSIWYG editor. How can I do that?

Advertisement

Answer

You can use the hook user_contactmethods to add some custom fields to the user page.

See this example:

if (!function_exists('modify_contact_methods')) {
    function modify_contact_methods($profile_fields) {

        // Add new fields
        $profile_fields['user_gender'] = 'Gender';
        $profile_fields['user_phone'] = 'Phone number';
        $profile_fields['user_city'] = 'City';

        return $profile_fields;
    }
    add_filter('user_contactmethods', 'modify_contact_methods');
}

However, if you want to do this without coding, you can use the plugin Advanced Custom Fields.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement