How do I add a widget to a specific blog post?

How do I add a widget to a specific blog post?

ILH_2019
Visitor
2 0 0

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. 

 

 

 

 

Replies 2 (2)

Small_Task_Help
Shopify Partner
775 25 69

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

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
ILH_2019
Visitor
2 0 0

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.