Only show Twitter profile info if filled in….
-
Hi all I have used the Yoast method to add Twitter contact field in my user profiles. Works great.
Link: User Contact Fields in WordPress 2.9But now I would like to show a Twitter user link only when the field is filled in… How can I do this?
I usethe_author_meta('twitter', $current_author->ID)to show the link, but how can I make it only show the link if the field is filled in?Code I use in functions.php:
function add_twitter_contactmethod( $contactmethods ) {
// Add Twitter
$contactmethods['twitter'] = 'Twitter';// Remove Yahoo IM
unset($contactmethods['yim']);return $contactmethods;
}
add_filter('user_contactmethods','add_twitter_contactmethod',10,1); -
I’m afraid you’re in the wrong forum. None of this applies to WordPress.COM users. You need to be at WordPress.ORG instead.
- The topic ‘Only show Twitter profile info if filled in….’ is closed to new replies.