Quantcast
Channel: built by Boon
Viewing all articles
Browse latest Browse all 10

Simple social sharing buttons

$
0
0
Lately there’s been a fair amount of chat about dropping social media buttons and some great solutions to the problems they cause too. Whether you should drop them or not (i’ll leave that debate) there is one option which is often overlooked – slim them right down!

This method has been around for ages, before the JavaScript / <iframe> widgets appeared which are now coming under scrutiny – due to them causing page loads to hang.

The solution

Uses the share via URL function built into each of these three social networks, leaving you free to customise the buttons as you wish with CSS. The URL query string should have its parameters urlencoded – you can use a tool like this to help.

	

Simple Social Sharing Buttons

Naturally, this means the buttons are super lightweight as there’s no JavaScript to load and nothing loaded externally. There are no counters, but as I explain below I think quicker page loads are far more important.

Check out the demo


What’s included

A styled, static example of the three buttons, along with a WordPress plugin allowing you to implement the buttons anywhere on your WordPress site. The plugin will automatically take the post title and permalink, urlencode them and create your buttons.

To use the WordPress plugin; download simple-social-sharing.php, upload it into your plugins folder and activate it. To call the buttons anywhere in your theme, use the function <?php simple_social_sharing('mattberridge'); ?> including your Twitter username.

If you wish to show/hide any of the buttons individually, add a further attribute e.g. <?php simple_social_sharing('mattberridge', '0,1,0');>

These are toggles for each button in the order Facebook, Twitter, Google+. 1 means show, 0 means hide.

I have also created a shortcode (to be used in the content body) which follows the same form e.g. [simple-social-sharing twitter="mattberridge" display="0,1,0"]

Download on Github


Caveats

This solution focuses only on the main three social networks; Twitter, Facebook, Google+. Unless you have a very specific audience I’d argue these are all you need (you definitely don’t need 20!) although I expect many others have similar share by URL functions should you want them.

This method doesn’t allow you to use counters, but I personally think they’re a bit pointless. If your website isn’t hugely popular, having “one share” of something is going to make it seem that way. Likewise if your site is massive, who wants to share something that 20,000 people have already…it’s all about being the first, right?

In my eyes reading good content should make you want to share something, not a number (another caveat – I welcome any studies on this that prove otherwise!). I would certainly prefer quicker loading times over seeing the number of shares, and perhaps your users would too.

Finally, yes this isn’t new or even complicated. But sometimes simplicity is best. And before anyone mentions me not using this type of button below…i’m on it! ;)


Viewing all articles
Browse latest Browse all 10

Trending Articles