If you like our themes and support, please SHARE our website! https://theme-sky.com/wordpress-themes/

Okay
  Public Ticket #1061361
How I add name of logged user to header?
Closed

Comments

  •  2
    Gabriel started the conversation

    Hello,

    Can you tell me how can I add the name of the logged user in the header.. Just to the right side ot the Wishlist link.

    Thanks

  •  568
    Stormit replied

    Hi Gabriel,

    You need to edit the header template file which you are using (header-v1.php, header-v2.php, ....). You can copy it to the child theme and edit it.

    You add the code below

    <?php if( is_user_logged_in() ): ?>
        <div class="user-info">
        <?php
        $current_user = wp_get_current_user();
        echo $current_user->display_name;
        ?>
        </div>
    <?php endif; ?>
    

    as my attached file.

    Best regards,

  •  2
    Gabriel replied

    Perfectttt.. Thanks a lot!