title: Get the post Author ID outside the WP Loop
body: <p>What I'm trying to accomplish is the code will auto detect the Author ID <code>&lt;?php the_author_ID(); ?&gt;</code> of the blogpost. Once it has the author ID, it will do a simple task. If the author # is equal to 2, call function sBadong. Else, if author ID is equal to 3, call function sJade. if two condition was not met, call function sBen.</p>
  
  <p>here's my code, but it's not working. I dunno what wrong's with it. can you help?</p>
  
  <pre><code>&lt;?php
  $author_id=$post-&gt;post_author;
  if ($author_id == "2") {
      echo sBadong();
  } elseif ($author_id == "3") {
      echo sJade();
  } else {
      echo sBen();
  }
  ?&gt;
  </code></pre>
  
  <p>The problem with the code above is it's not reading the Author Number of the post. It always returning the function sBen(); and ignore all if and else statements.</p>