• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Adding A Twitter Follow & Share Button To WordPress

Twitter Follow and Share ButtonsTwitter offers an official twitter widget which you can use to create twitter buttons in WordPress.

You get 4 options to choose from once you arrive at the Twitter Resources page.

Once you’ve created you button, simply copy and paste the code into WordPress HTML editor, save the changes and you’re done.

Follow @wordpress_blogs

Twitter Follow Buttons

You can insert the button at the beginning or end of all posts by using WordPress Hooks.

Follow @brad_dalton

Javascript or iframe Twitter Button?

Javascript configuration options – You can also customize the twitter button to include or exclude:

User to follow            (in the anchor URL)
Followers count display       data-show-count
Language       data-lang
Width       data-width
Alignment       data-align
Show Screen Name       data-show-screen-name
Size       data-size

Javascript Example:

[php]<a class="twitter-follow-button" href="https://twitter.com/wordpress_blogs" data-show-count="true" data-lang="en">Follow @wordpress_blogs</a>
<script type="text/javascript">// <![CDATA[
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
// ]]></script>[/php]

iFrame Configuration options – You can also customize the twitter button to include or exclude:

User to follow      screen_name
Followers count display      show_count
Language      lang
Size          Not Supported
Width          Not Supported
Alignment          Not Supported
Show Screen Name      show_screen_name

iFrame Example :

[php]
<iframe style="width: 200px; height: 15px;" src="//platform.twitter.com/widgets/follow_button.html?screen_name=wordpress_blogs" frameborder="0" scrolling="no" width="320" height="240"></iframe>
[/php]

If you prefer to use a plugin, check out the best social media plugins for WordPress by popularity.

Follow @wordpress_blogs

I’m sure there’s a plugin around that offers an easier way to configure all these options. Know of any?

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.