Tagged: header
Hi,
how can I show a status like “Welcome back USERNAME” in the header?
Tx,
Frank
Hey Frank!
Where in the header exactly? this code will do it:
<?php
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
echo "Welcome $user->display_name";
}
?>
Regards,
Josue
Thank you, this helps.
I would like to put that on the very first line. See screenshot:
https://www.evernote.com/shard/s74/sh/12d5c473-c03e-4e85-95be-b4c2ac47bd02/aacc8cb3ffadd7362f281d04952c57f0
Where would the code then get inserted?
Tx,
Frank
Hi,
Can you create an administrator account and post it here as a private reply?
Regards,
Josue
Hey!
Edit header.php, find this code on line 116:
$nav = wp_nav_menu($args);
echo $nav;
Below, add this code:
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
echo "<div id='header-welcome'>Welcome ". $user->display_name ."</div>";
}
Add this on Quick CSS or custom.css:
#header-welcome {
float: left;
font-weight: bold;
height: 30px;
line-height: 10px;
margin-left: 20px;
}
Best regards,
Ismael
Thank you, works perfectly!