Title: Printing Current User Name using PHP
Last modified: August 19, 2016

---

# Printing Current User Name using PHP

 *  [trimmode](https://wordpress.org/support/users/trimmode/)
 * (@trimmode)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/printing-current-user-name-using-php/)
 * 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>';
       						}
       		    ?>
   
       	    </span>
       ```
   
 * Thanks for any help,
    Trimmode

The topic ‘Printing Current User Name using PHP’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [trimmode](https://wordpress.org/support/users/trimmode/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/printing-current-user-name-using-php/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
