title: Show Author name in single.php (Wordpress)
body: <p>I need to display the Author of the post in the single.php file in Wordpress. The reference indicates that the_author(); only works within the loop.</p>
  
  <p>I've been looking for others forums and nothing found.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <pre><code>    &lt;div class="bar_info"&gt;
           &lt;?php echo "By: ".the_author(); ?&gt;
           &lt;?php
                  foreach((get_the_category()) as $category) { 
                      echo category-&gt;cat_name.', ';
                  }
           ?&gt;
      &lt;/div&gt;
  </code></pre>