Add a Twitter button to your blog

If your theme does not include a Twitter button and you want to add one, you will need to edit your theme. Contact the designer of your theme if you're not sure if your theme already includes a Twitter button – chances are, there is a theme setting to add Tweet buttons to your blog.

If your theme doesn't have that feature:

  1. Find the theme you want to edit, click the ... button, and then click Edit HTML/CSS.

  2. Under the Templates folder, locate and click on article.liquid and blog.liquid to open them in the online code editor.

    Article blog liquid
  3. In blog.liquid and article.liquid — both templates will need to be edited in the same way - look for this code:

    {{ article.content }}

    Above the element that outputs the article content, paste the following code:

    <script src="" type="text/javascript"></script>
       <a href="" class="twitter-share-button"
          data-url="{{ shop.url }}{{ article.url }}"
          data-text="{{ article.title | escape }}"
  4. Replace your_screen_name with your Twitter account alias, without the @. For example, Shopify's twitter account name is shopify.

  5. Save your changes.

Repeat the above procedure for both templates.

Want to discuss this page?

Visit the Shopify Community