Code for social media buttons

I have never done social media buttons…

what is the code for the typical social media buttons one sees everywhere
(I mean so users can share a page from my website on FB, Twitter, G+, Pint., etc…)

I have never done this… I don’t have a clue…

would appreciate some enlightenment…

thank you very much…

PS: my website is done the traditional way – no WP, no or other blog system… my own hand-coding… thanks…

Many of the popular social site’s have pre-built buttons and plugins that support that type of functionality out of box. You can also create those type of buttons very easily as well with html/css and some icons with the links or api’s needed for the required functionality.

Link to facebook

1 Like

thank you. is this just the FB button??

what about other sm buttons? obviously what I’m mainly looking for is the code for the sharing function… HTML & CSS I can handle…:wink:

thank you…

Yes, but if you look on Twitter, G+, etc… you can find various buttons and widgets there.
Seek and you shall find.

Sitepoint has a good article - https://www.sitepoint.com/social-media-button-links/

1 Like

I hadn’t seen that one. I was just thinking how the social buttons are the slowest part of many pages.
Must read that.

great… thanks…

Do check out the article that @bluedreamer linked.
I use social buttons and they are a real drag on page speed with their bloated scripts.
Something I need to remedy, so I’m looking into that now.

I most certainly will…

thank you all very much for your responses…

looking further into this:

have a question re encoding the url:

am just wondering if it’s absolutely necessary to encode the url… b/c [here] (http://blog.hubspot.com/blog/tabid/6307/bid/29544/The-Ultimate-Cheat-Sheet-for-Creating-Social-Media-Buttons.aspx)
it doesn’t say so (again, I’m only interested in the ‘share’ functionality, not in any of the others…)

here are instructions on this page for FB share funcionality:

How to Add Facebook Anchor Text Share Links

To create your own Facebook share links, replace the orange highlighted URL below with the URL of the content you want to promote. Then link the full URL to the anchor text you want to appear in your content.

http://www.facebook.com/share.php?u=http://bit.ly/vOKpgC
[here ‘u’ param value is highlighted in orange]

See One in Action:

Share This Post on Facebook!
[this is a link to share the page you’re on in FB, and the url is not encoded]

thank you…

You can go for search in Google where you can get lot of coding for your website

yes I know… I’m asking b/c on some sites it says to encode the url on others it doesn’t say so… so am just wondering if it’s necessary to do that…

thank you…

You could try it without and see if it works.
Though it should not be too much trouble to encode.
If it’s a static HTML page, you can use a tool like this.
I have implemented this on a site where I use PHP to add the link to the generic page template.

<?php echo urlencode($canonical); ?>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.