If you want to have a full control over the look of sharing buttons for Twitter, Facebook, Google+ and Pinterest, you’ll find below codes for text-only versions.
Wrapping the code in css class will let you customize the look of sharing buttons and match them perfectly to your WordPress theme.
Place the codes inside the loop in single.php and page.php files.
All scripts open a new resizeable sharing window on top of the current page, so this is very similar to default sharing buttons.
Text-only Twitter button
The code is:
<a target="_blank" rel="nofollow" href="https://twitter.com/share?text=&url=&via=YOURTWITTERHANDLE" onclick="window.open(this.href,this.target,'width=600,height=400,resizeable,scrollbars');return false;">Twitter
The only thing to customize is to replace “YOURTWITTERHANDLE” with your handle without “@” mark. Thanks to that you’ll have “via @handle” at the end of each tweet.
You can also replace “Twitter” in the code to “Tweet it” or any other text. Same applies to other buttons as well.
Text-only Facebook button
Copy and paste the code:
<a target="_blank" rel="nofollow" href="https://www.facebook.com/sharer.php?t=&u=" onclick="window.open(this.href,this.target,'width=600,height=400,resizeable,scrollbars');return false;">Facebook
Text-only Google+ button
The code is:
<a target="_blank" rel="nofollow" href="https://plus.google.com/share?url=" id="google-plus" onclick="window.open(this.href,this.target,'width=500,height=400,resizeable,scrollbars');return false;">Goolge+
Text-only Pinterest button
The code is:
• • •
When you use W3C Markup Validator to find html errors on your blog, you’ll see that element returns spaces, and it doesn’t validate very well.
If you want your site to have as little validation errors as possible, consider exchaning in Twitter, Facebook, and Google+ codes to .
Buttons under this post use the scripts described above, so you can test them before implementing on your blog.
Other posts with WordPress tips:
[pi-archive number=5 tag=”wordpress” ]