title: how to show user's username when logged into a wordpress site?
body: <p>I would like to have the header of my site reading "Logged in as " when a user is logged into my wordpress site. </p>
  
  <p>I dont know how to echo the username of the current user, heres the code I'm got...</p>
  
  <pre><code>&lt;?php
  
  if ( is_user_logged_in() ) {
  echo '&lt;ul id="mem" class="clearfix"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Logged in as Username&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Logout&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;';
  } else {
  echo '&lt;ul id="mem" class="clearfix"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Register&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Login&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p>and I'd like to replace Username.</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Mark</p>