Printing Current User Name using PHP (1 post)

  1. Trimmode
    Posted 7 years ago #

    I gave it my best all day today and I still couldn't make this php code work. Like the top dashboard information in the admin, I am trying to get it to print "Howdy, [current username] | Profile | Log Out" at the top of the screen in a <div>.

    It currently prints everything EXCEPT the current user's name AND I can't get it to recognize a new class with the "|" dividers.

    <span class="login_container">
    	         <?php global $user_ID;
                            if ($user_ID) {
                                echo "Howdy "; echo $user_identity; echo '<class="login_light">' . " | ";
                            wp_register('<class="login">'); {echo " | ";}
    						if($user_ID) {
    							echo '<class="login"><a href="' . site_url('wp-login.php?action=logout', 'login') . '">' . __('Log Out', 'atahualpa') . '</a>';
    						} else {
    							echo '<class="login"><a href="' . site_url('wp-login.php', 'login') . '">' . __('Log In', 'atahualpa') . '</a>';

    Thanks for any help,

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.