Only show Twitter profile info if filled in….

  • Unknown's avatar

    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.9

    But now I would like to show a Twitter user link only when the field is filled in… How can I do this?
    I use the_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);

  • Unknown's avatar

    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.