Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:55:00+00:00 2026-05-22T23:55:00+00:00

So, I’ve been testing out Twitter’s new Follow buttons , and while browsing ZDNet.com,

  • 0

So, I’ve been testing out Twitter’s new Follow buttons, 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: http://www.zdnet.com/blog/btl/sony-predicts-32-billion-loss-following-psn-hacking-japan-earthquake.

I tried copying the same idea on my blog LonePlacebo.com, with moderate success.

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.

    <?php if ( arras_get_option('display_author') ) : ?>
                    <div class="about-author clearfix">
                        <?php echo get_avatar(get_the_author_meta('ID'), 48); ?>
                        <h4>Written by: <?php the_author(); ?></h4>
                        <?php the_author_meta('description'); ?>
                        <!--check if author is Tony -->
                    <?php if (the_author() == "Tony Hue") : ?>
                        <a href="http://twitter.com/tonykhue" class="twitter-follow-button">Follow @tonykhue</a>
                        <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
                    <?php endif; ?>                     
                        <!--check if author is Joseph-->
                    <?php if (the_author() == "Joseph Chang") : ?>
                        <a href="http://twitter.com/ballinacup" class="twitter-follow-button">Follow @ballinacup</a>
                        <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
                    <?php endif; ?>                     
                    </div>
    <?php endif; ?>

Any help would be appreciated. Thanks!

Update 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.

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?

<?php if ( the_author_meta('twitter', $current_author->ID) ) : ?> 
          <!--if no Twitter info provided -->
         <a href="http://twitter.com/loneplacebo" class="twitter-follow-button">Follow @loneplacebo</a>
         <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>                      
<?php else : ?> 
          <!--else, link to author's twitter account-->
          <a href="<?php the_author_meta('twitter', $current_author->ID); ?>" class="twitter-follow-button">Follow @tonykhue</a>
              <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<?php endif; ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:55:01+00:00Added an answer on May 22, 2026 at 11:55 pm

    Instead of the_author() use get_the_author(). the_author() prints the name, latter returns the name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.