Search
 
SCRIPT & CODE EXAMPLE
 

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(); } ?>
Comment

PREVIOUS NEXT
Code Example
Php :: woocommerce recipient email default change Function 
Php :: include navbar or part in layout in laravel blade template 
Php :: validate file count with validate in laravel 
Php :: php pdo get id selected by href 
Php :: switch case or case php 
Php :: yii1 findall as array listData 
Php :: wp wc php if not is single product page 
Php :: media library laravel maximum allowed size 
Php :: debugger in laravel 
Php :: livewire custom attribute 
Php :: exit and echo php 
Php :: reindex after post api magento 2 
Php :: html windows logo 
Php :: php initialize two dimensional array dynamically 
Php :: phpmailer doesnt work on infinityfree 
Php :: convertidos de 24 12 hr php 
Php :: READIMAGE FUNCTION PHP 
Php :: php check if input is a positive integer 
Php :: php loop through obect 
Php :: selecting data from two tables in database php 
Php :: laravel How to include model attribute automatically 
Php :: php print fetch 
Php :: php strftime year 2 digits 
Php :: laravel make api resource 
Php :: laravel log query for model (full) 
Php :: php find in array 
Php :: php = 
Php :: server.php not found 
Php :: Laravel whereHas with count 
Php :: laravel get 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =