Adding custom CSS and JS to Shopify

gagneet picture gagneet · Dec 9, 2013 · Viewed 41.2k times · Source

I am working on getting vertical tabs for a page on Shopify, using the 'Atlantic' theme. As this theme does not have vertical tabs by default, I have used the external JS and CSS "jquery-jvert-tabs".

My question is, if I upload the JS and CSS files as assets, how do I link them to the page on which I want to use these and how to make use of these on the page after that, if I have certain style elements available there too?

Answer

jlcharette picture jlcharette · Jan 5, 2014

Simply upload your filename.js file in the assets folder.

then drop the following in your theme.liquid head section:

{{ 'filename.js' | asset_url | script_tag }}

by the way, you should rename your file and add .liquid extension

filename.js.liquid

Good luck!