WordPress has fields for fields for author contacts, but it has not been updated in ages. So by default you do not have an ability to add author’s twitter or facebook. With this hack you can add this information on their profile page.

First open your functions.php and paste the following code:

    <?php
    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);
    ?>

The above code will add two extra fields on your user-edit page named twitter and Facebook. You can display the code with the following code in your author.php file.

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

0 Response to "Display Author’s Twitter and Facebook Information on their Profile Page"

Post a Comment

Google Translator

Search Box

Blog Archive

User Status

Free counters!

About Me

ADMIN
Pakistan
View my complete profile

Recent Posts

Recent Comments