• Hi all,

    I am trying to display the Howdy (Changed to ‘Welcome Back’)Message on my home page – I am using the code from admin-header.php

    <div id="user_info">
    <p><?php printf(__('Welcome Back, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity) ?> |
    <a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
    </div>

    It displays the “Welcome Back” but no username – I am signed in as a user?

    Do I need to add a call to $user_identity? Would anyone know how to do this.

    Thanks, Joe

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try:

    <?php if ( is_user_logged_in() ) :
    global $current_user;
    get_currentuserinfo(); ?>
    <div id="user_info">
    <p>Welcome Back, <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php" title="Edit your profile"><?php echo $current_user->display_name;?></a> |
    <a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
    </div>
    <?php endif;?>
    Thread Starter joekane

    (@joekane)

    Slightly modified and working perfect

    <?php global $current_user; get_currentuserinfo(); echo 'Welcome Back ' . $current_user->user_firstname . "\n";?>

    Is there a way to apply a style sheet to the output?

    This is outputing perfectly

    <a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a>

    See Screenshot

    https://joekane.u109.hosting365.ie/screenshot.jpg

    Thanks, Joe

    Thread Starter joekane

    (@joekane)

    Got it working – Thanks for the Help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Howdy Message on Home Page’ is closed to new replies.