CurrentUser

 global $current_user; wp_get_current_user(); ?>
<?php if ( is_user_logged_in() ) { 
 echo 'Username: ' . $current_user->user_login . "\n"; echo 'User display name: ' . $current_user->display_name . "\n"; } 
else { wp_loginout(); } ?>

<?php
$user = get_current_user();

   echo $current_user->user_login;

?>
Subscribe
Notify of
error: Content is protected !!
0
Would love your thoughts, please comment.x
()
x