Social media is all the rage for the past few years. And of course, if you’ve been online any time in the past 5 years or so, and definitely if you have a blog - you probably already know that. Bloggers use social media to drive traffic, so we want to push-push-push it in our readers face.
When facebook introduced the “like” button, that was a true revolution: all the reader has to do is click once - and our page is visible to all of the user’s friends. Then came Twitter, Google+ and Pinterest and offered their own button for easy sharing. However, all these buttons caused a serious design issue. They are dynamic (how dare they?). The height and/or width might change according to the button’s settings and how many people shared the page.
There are several different ways to deal with this issue, most of which cause silly gaps between the buttons or require various types of floating vertical areas which contain the social media buttons. I didn’t want to be quite so “in your face”, so I worked on it a little bit and I think I came up with a nice layout which requires a minimum amount of size mismatch, a horizontal layout and no gaps whatsoever. You can take a look at the bottom of this post for an idea of how it’s going to look when you’re done. If you don’t like it, I suggest you stop reading now…
Note and warning: Before you do this, please back up your template. If you don’t know what that means, don’t even try. Wherever there is a yellow highlight, you should replace the values with your own (according to what is needed in that location).
[This tutorial covers the code necessary for setting the image for the Pinterest button dynamically, so no need to do both.]