Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How do I display logged-in username IF logged-in? site:wordpress.stackexchange.com

<?php global $current_user; wp_get_current_user(); ?>
<?php if ( is_user_logged_in() ) { 
 echo 'Username: ' . $current_user->user_login . "
"; echo 'User display name: ' . $current_user->display_name . "
"; } 
else { wp_loginout(); } ?>
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #How #I #display #username #IF
ADD COMMENT
Topic
Name
2+3 =