Help with conditional link code to display name
-
I have a conditional link to show login/out and profile depending on if the user is logged in or not. What I would like is to show the user’s nickname or id next to the logout link, ive tried several bits code to no avail.
The current code I use is<?php
global $user_login, ;
get_currentuserinfo();
if ($user_login){
echo ‘Logout<br/>
Profile<br/>’;
}
else {
echo ‘Not Registered? Click here!‘;
}Ive tried a lot of different code variations to display the user nickname in the logout link but none work. Heres an example of one them that does not work
<?php
global $user_login, $user_nickname ;
get_currentuserinfo();
if ($user_login){
echo ‘Logout <?php echo $user_nickname ?><br/>
Profile<br/>’;
}
else {
echo ‘Not Registered? Click here!‘;
}any ideas out there
The topic ‘Help with conditional link code to display name’ is closed to new replies.