Whether you just like to put up a personal greeting or have a site that has quite a few users, something a welcome message is nice. I have seen a few people put this together and have a centralized paged where users can log in, read the personal message, and then go on their merry way using the website.
The code is really simple. This code calls the current user. If you want to only let people like contributors or other roles see the message, you have to adjust the level_0 to any of the levels corresponding with the roles. (Example: administrator is 10).
Please note that you need to be careful on what you greet your visitors. If your normal readers expect you to be goofy, or a little on the strange side, that is fine. However, I have seen a couple sites that have creeped me out with some weird greetings.
<?php global $user_ID; if( $user_ID ) : ?> <?php if( current_user_can('level_0') ) : ?> Welcome < ?php global $current_user; get_currentuserinfo(); echo ($current_user->user_login); ?> <?php else : ?> <?php endif; ?> <?php endif; ?>
You can edit the little welcome message to whatever you like.