title: Dynamic Twitter Follow button
body: <p>So, I've been testing out Twitter's new <a href="https://twitter.com/about/resources/followbutton" rel="nofollow">Follow buttons</a>, and while browsing ZDNet.com, I noticed that in their author bios, they have follow buttons for each author. Interestingly, the button would change according to who the author was. Here is an example: <a href="http://www.zdnet.com/blog/btl/sony-predicts-32-billion-loss-following-psn-hacking-japan-earthquake" rel="nofollow">http://www.zdnet.com/blog/btl/sony-predicts-32-billion-loss-following-psn-hacking-japan-earthquake</a>. </p>
  
  <p>I tried copying the same idea on my blog LonePlacebo.com, with moderate success. </p>
  
  <p>The code below is my author bio section using some PHP. I used some if statements to check the author, and it did produce the dynamic button as I was hoping for. However, it also output the author's name twice in plain text. </p>
  
  <pre><code>    &lt;?php if ( arras_get_option('display_author') ) : ?&gt;
                      &lt;div class="about-author clearfix"&gt;
                          &lt;?php echo get_avatar(get_the_author_meta('ID'), 48); ?&gt;
                          &lt;h4&gt;Written by: &lt;?php the_author(); ?&gt;&lt;/h4&gt;
                          &lt;?php the_author_meta('description'); ?&gt;
                          &lt;!--check if author is Tony --&gt;
                      &lt;?php if (the_author() == "Tony Hue") : ?&gt;
                          &lt;a href="http://twitter.com/tonykhue" class="twitter-follow-button"&gt;Follow @tonykhue&lt;/a&gt;
                          &lt;script src="http://platform.twitter.com/widgets.js" type="text/javascript"&gt;&lt;/script&gt;
                      &lt;?php endif; ?&gt;                     
                          &lt;!--check if author is Joseph--&gt;
                      &lt;?php if (the_author() == "Joseph Chang") : ?&gt;
                          &lt;a href="http://twitter.com/ballinacup" class="twitter-follow-button"&gt;Follow @ballinacup&lt;/a&gt;
                          &lt;script src="http://platform.twitter.com/widgets.js" type="text/javascript"&gt;&lt;/script&gt;
                      &lt;?php endif; ?&gt;                     
                      &lt;/div&gt;
      &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Any help would be appreciated. Thanks!</p>
  
  <p><strong>Update</strong> I've tried updating the code so as to allow for more author's in the future. The call to get_author_meta() in the updated code below returns the info provided in the author's profile in the Twitter field. I want the code to display a default Follow button to @loneplacebo if the author has not provided any Twitter info, but if they did, display a button linking to their Twitter account. </p>
  
  <p>Problem though is that if no Twitter account is provided, the code does to return the default button as expected. Any ideas how to solve this one?</p>
  
  <pre><code>&lt;?php if ( the_author_meta('twitter', $current_author-&gt;ID) ) : ?&gt; 
            &lt;!--if no Twitter info provided --&gt;
           &lt;a href="http://twitter.com/loneplacebo" class="twitter-follow-button"&gt;Follow @loneplacebo&lt;/a&gt;
           &lt;script src="http://platform.twitter.com/widgets.js" type="text/javascript"&gt;&lt;/script&gt;                      
  &lt;?php else : ?&gt; 
            &lt;!--else, link to author's twitter account--&gt;
            &lt;a href="&lt;?php the_author_meta('twitter', $current_author-&gt;ID); ?&gt;" class="twitter-follow-button"&gt;Follow @tonykhue&lt;/a&gt;
                &lt;script src="http://platform.twitter.com/widgets.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;?php endif; ?&gt;
  </code></pre>