How To Feature Your Twitter And Facebook Account

0
54
Apps blur button close up
Photo by Pixabay on Pexels

 

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>

LEAVE A REPLY

Please enter your comment!
Please enter your name here