Need help with is_user_logged_in

Discussion in 'WordPress' started by Rajnish357, Nov 25, 2011.

  1. #1
    This is the basic code:
    <?php
    if ( is_user_logged_in() ) {
        echo 'Welcome, registered user!';
    } else {
        echo 'Welcome, visitor!';
    }
    ?>
    PHP:
    But when user is logged in I want the out put like this: Welcome, FIRST NAME OF THE PERSON, if first name field is empty then the USERNAME of the logged in user.
     
    Rajnish357, Nov 25, 2011 IP