Multisite – Echo admins profile meta

According to the Codex, get_user_id_from_string() is deprecated, and should be replaced with get_user_by().

<p>
<?php
$thisblog = get_current_blog_id();  // probably don't need this anymore
$admin_email = trim( get_option( 'admin_email' ) );
$admin_user = get_user_by( 'email', $admin_email ) );
$phone_number = get_user_meta($admin_user->ID, 'phone', true);
if($phone_number!='') { ?>
<?php echo $phone_number; ?>
<?php } else { ?>
<?php } ?></p>

I’ve also replaced your get_blog_option() with the simpler get_option(), since get_blog_option() essentially does switch_to_blog(), get_option(), and restore_current_blog(). Since you’re going after the information in the current blog anyway, the switch_to_blog() and restore_current_blog() are superfluous.

If this code doesn’t work, do some debugging — add in var_dump( $admin_email) to verify that the get_option() retrieved something, etc.

Edited to respond to comments

When you create a new site in WordPress Multisite, you are asked for an administrative email address. That user will be assigned as the site’s first administrator. However, if that user is then removed from the site, the admin_email option is not removed from the database.

Check your user list in your wp-admin pages, and make sure that there is, in fact, an administrator-level user with exactly the same email address that you got from your var_dump( $admin_email ); call. If there is, count the number of characters in the email address. I’m wondering if you’re seeing a whitespace issue (eg, an extra space inserted in the $admin_email or something). I’ve added trim() to the code sample, but I may be grasping at straws.