Home » Labs » How to show user info in WordPress site  

How to show user info in WordPress site


Filed under Labs

Add below code to your WordPress theme and it will display the current user information.

 
<?php global $current_user;
      get_currentuserinfo();
 
      echo 'Username: ' . $current_user->user_login . "\n";
      echo 'User email: ' . $current_user->user_email . "\n";
      echo 'User first name: ' . $current_user->user_firstname . "\n";
      echo 'User last name: ' . $current_user->user_lastname . "\n";
      echo 'User display name: ' . $current_user->display_name . "\n";
      echo 'User ID: ' . $current_user->ID . "\n";
?>

You can refer more information by clicking here

It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook

Posts you may like: