Adding something to a Visitor logged in menu bar

I need to add some type of wording to the menu bar for visitors who are logged in (not admin) so that it shows they are logged in. Maybe something that says, "Welcome, Name" and stays on the menu bar for as long as they are logged in.

  • Predrag Dubajic

    Hey @Dawn,

    Hope you're doing well today :slight_smile:

    You can do this by adding little code snippet in your header.php file. If you want to add it at the end of your menu search for closing tag, this is probably used to close your menu and add this code just before that line:

    <li>
    	<?php global $current_user;
    	if ( is_user_logged_in() ) {
    	    echo 'Welcome, ' . $current_user->user_login;
    	}
    	?>
    </li>

    Let me know if this is what you wanted to do.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.