How To Feature Your Twitter And Facebook Account

03.06.10 by Jerome in Tutorials

How To Feature Your Twitter And Facebook Account

If you want to add a section for your Facebook or Twitter account into your contact info profile into the backend of your WordPress blog, follow the steps below:
contact info How To Feature Your Twitter And Facebook Account

Simply drop this code below in your function.php file to feature your Twitter and Facebook URL account.

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

Now you can promote your social websites in your post by dropping the code below in your single.php page in the loop.

<p><a href="<?php the_author_meta('twitter', $current_author->ID); ?>" target="_blank" rel="nofollow">Twitter</a> - <a href="<?php the_author_meta('facebook', $current_author->ID); ?>" target="_blank" rel="nofollow">Facebook</a></p>

Related posts:

facebook, function, profile, twitter

Get More Wordpress Tips & Tricks

Liked this post? subscribe to our email updates or RSS feed!

  • http://securehostinghawaii.com/ Mauideveloper

    Wordpress just keeps getting more functional and easy to use! nice

blog comments powered by Disqus