Making wordpress widget display username instead of full name

Discussion in 'Customization & add-ons' started by bongpig, Jan 15, 2013.

  1. bongpig

    bongpig New Member

    Joined:
    Jan 4, 2013
    Messages:
    11
    Hello all

    As the title says, when a user is logged in I want the welcome message to display the username, not the full name.

    I know I need to tweak this line:-
    <div><b><?php _e('Welcome', 'am4-plugin');?> <?php echo $user['name_f'];?> <?php echo $user['name_l'];?>!</b></div>

    In the widget_after_login.phtml file

    But I have no idea what values I need to use to point to the username.

    Can anybody give me a hand please? Thanks.
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    instead of:
    <?php echo $user['name_f'];?> <?php echo $user['name_l'];?>!
    try
    <?php echo $user['login'];?> !
    or
    <?php echo $user['username'];?> !


    David
  3. bongpig

    bongpig New Member

    Joined:
    Jan 4, 2013
    Messages:
    11
    That's perfect!

    Thanks David. I appreciate your help.

Share This Page