This is an advanced tutorial and is not supported by Shopify. Knowledge of HTML, CSS, JavaScript, and Liquid is required. Consider hiring a Shopify Expert if you aren’t comfortable doing the steps in the tutorial.
There are two ways you can get social media buttons:
Option 1
Get an app that does all of the work. Check out the Social media section of the App Store. Some of our themes from the Theme Store already come with this feature enabled. Check to see if your theme already has a social media button by going to the theme editor and checking the Header, Sidebar, Homepage, and/or Footer menus.
Note: This method may provide addition support options compared to coding this yourself. If you anticipate needing assistance consider an app!
Option 2 (Advanced)
Code the buttons into any theme you want.
For finding Facebook, Pinterest and other social site buttons and icons go to their websites and look for the buttons or use the awesome Icon Finder.
Adding the buttons1. From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
To get your button on your site we are going to upload the social media icon image to your theme. Click the Assets folder to open it.
Choose the icons file on your computer and click Upload asset.
Now that the physical button icon is there, we are going to add in the code to make the button work. Click the theme.liquid file to open it in the online code editor.
The line you paste in the code depends on where you want the buttons to appear in your theme. Look through the code to find your perfect location. This code example is specifically for Twitter but will also work for Facebook, Pinterest and other social media:
{{ 'my-twitter-button.png' | asset_url | img_tag | link_to: 'https://twitter.com/iamawesome', 'follow me on twitter' }}
Alternate button code with HTML:
<a href="https://twitter.com"><img src="my-button.jpg" alt="Follow on Twitter"/></a>
Save your changes.
For more information on theme editing, read our design policy.
Hi, I tried to do your solution but on my debut theme the icons downloaded from icon finder show up as ugly little pages with a mountain and a cloud (not the icon). The code says jpg but even as I input png I get the same result. Is there a way to fix it so that I get the real icon to show up?
You need to re-adjust the SVG image size to 20x20px and save it as SVG file again, in a vector image editor such Adobe Illustrator.
Copy and paste this code from another social media icon under your Snippets (say for example “icon-facebook.liquid”), into the NEW social media icon, say “icon-linkedin.liquid”:
Open the SVG file in your text application and file this d=“svg data”; copy and paste this long string of svg data into this under your NEW social media icon, say “icon-linkedin.liquid”:
Thanks a million for this quick guide to add social media buttons. I’ve tried to add this code, and it does work. However, like for other people commenting here, I get a huge Instagram/FB icon, and when trying to adjust the size in CSS, the icon gest displaced to the lowest corner on the left side of the page, and it stops working. Would you be able to please guide me on what’s going wrong here. How could I place the icon properly in the footer, with the right seize and so it continues working?
I’ve done these steps and created the new “icon-linkedin.liquid” file with the SVG data from my image. However, it’s not showing up as of yet. How do i link the image file to the snippet as I can’t see how it would know where to find the image etc..
Your code looks correct; you should have edit and saved the SVG file via text application (not sure whats the impact if you do it directly on Shopify Edit Code)
Check you have file/upload this SVG file onto Assets as mentioned by TyW’s original comment thread “5. Choose the icons file on your computer and click Upload asset.” (This should be the location to upload your SVG file.
If all else fails, try again (remove all the steps you had done):
A) Follow TyW’s original comment thread.
AND WHEN YOU SEE A HUGE ICON…
B) Go to my comment dated and timed 07-06-2020 09:15 AM.
thank you for this tutorial. im just wondering where you paste this code in? I was a bit confused by the description, as I cant find any similar code that is already used for the social icons already showing.
hey there, thank you for explaining how to get rid of the bit logo, I tried your instructions about the svg text editor code into the snippet. when I pasted it into the ‘d=’ bit, it just froze my code page. I tried it on 2 different windows and it didn’t like it at all, it won’t even let men cross out of the window. any suggestions? `I was thinking maybe because from svg text from the text editor is so big?