Is there anyway to show FIRSTNAME LASTNAME rather than username?
I managed to put the username in like this:
<?php
global $current_user;
if ( isset($current_user) ) {
echo $current_user->user_login;
}
?>
Hello,
I am a newbie and want to implement this function in my blog.
I was hoping, that there was a plugin for that function, so that I do not have to modify files … but I couldn’t find any.
In which file(s) do I have to add the above code?
(I couldn’t find a “how to” for this …)
In which file(s) do I have to add the above code?
Where do you want it to go on your site?
Hey, this is exactly what I needed. Thanks lot moshu and krushinfo for the link and code. 🙂
Here is a nice example I came up with.
<?php if (is_user_logged_in()){
global $current_user; get_currentuserinfo();
echo('Welcome, ' . $current_user->user_firstname . ' | ');
}
else {
echo "Welcome, Visitor | ";
};
?>
The user_firstname
can be changed to a number of things. See: Function_Reference/wp_get_current_user