Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi- I am struggling to determine where I add the widget code for a specific blog post. I need to add a widget for a collaboration, but cannot find the location under "edit code" in our theme. There are numerous locations on the
sidebar but I need to apply it to a blog that is not yet live.
Hi,
- Note the handle of the blog post
- Edit the Blog post template and add conditional statement
Code example
{% if article.handle == 'special-collaboration' %}
<!-- Your Widget Code Here -->
<div class="widget-container">
<!-- Widget code or embed code goes here -->
</div>
{% endif %}
Replace special-collaboration with the handle of blog post and add widget code in the specified section.
Embed the widget code
This was really difficult to understand but I appreciate the reply. Here's what I did: On the toolbar of the blog draft, I selected the </> icon (show HTML) and then pasted the widget code at the end of the content. This worked perfectly.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024