skip to Main Content

In shopify theme, I want to integrate following bootstrap link on theme.liquid file.

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>

How can i integrate bootstrap on my theme?

2

Answers


  1. If you just want to load everything so it works, add this code in the head of Admin > Themes > Template Editor > theme.liquid

    Make sure to paste the code in-between the <head> </head> tags.

    you can try to load them as the snippet bellow :

    {{ '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js' | script_tag }}
    {{ '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' | stylesheet_tag }}
    {{ '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css' | stylesheet_tag }}
    
    Login or Signup to reply.
  2. It is a better practice to have your theme feed off CDN links, but also have it resort to a local bootstrap copy just in the case the CDN server is down.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search