Skip to content
All articles

Shopify

Adding a Custom liquid block in Shopify's Horizon theme

How to add a Custom liquid block under the Buy buttons on a Shopify Horizon product page, what to paste into it, and what to check when it does not show up.

Provedly team··5 min read

To add a Custom liquid block in Shopify's Horizon theme, open Online Store, then Themes, and click Customize. Switch the template picker at the top to your product template, find the product information section in the left sidebar, hover just under the Buy buttons block until a plus appears, click it and choose Custom liquid. Paste your code into the block's text box and click Save. The block now appears under the Add to cart button on every product that uses that template.

That is the short version. The rest of this guide covers what to check before you start, what you can paste, and the usual reasons a block does not appear.

Before you start

A few things save time later:

  • Work on a copy. In Themes, use the three-dot menu on your live theme and choose Duplicate. Make the change on the copy, preview it, then publish. If you edit the live theme directly, shoppers see every step.
  • Know which template your products use. Most stores use the default product template. Some have extra templates for certain products, and a block added to one template does not appear on the others.
  • Check your theme version. Horizon and the themes built on it are updated over time, and block names and the exact position of buttons in the editor can differ between versions and between Horizon-family themes. If a label in this guide does not match your screen, look for the nearest equivalent.

Older themes also have a Custom liquid block, but they may list it under a different section, or only allow it as a separate section rather than inside the product information.

Step by step: add the block under Buy buttons

  1. In your Shopify admin, open Online Store, then Themes.
  2. On the theme you want to edit, click Customize.
  3. In the drop-down at the top of the editor, which usually reads Home page, choose Products, then the template your products use, usually Default product.
  4. In the left sidebar, open the product section that holds the title, price and buttons. In Horizon its blocks are listed as a nested group, with Buy buttons among them.
  5. Hover your pointer just under Buy buttons. A thin line with a plus appears between blocks. Click the plus. If you do not see it, use the Add block link at the bottom of that group and then drag the new block under Buy buttons.
  6. In the block picker, search for Custom liquid and select it.
  7. In the block's settings on the right, paste your code into the Liquid box.
  8. Check the preview on desktop, then switch to the mobile preview with the icon at the top of the editor.
  9. Click Save.

The order of blocks in the sidebar is the order on the page. Drag the Custom liquid block up or down if you want it above the buttons or further down.

What you can paste

The box accepts HTML and Liquid, Shopify's template language. Some common uses:

You want Paste something like
A short line of text <p>Ships within 2 business days. Free returns for 30 days.</p>
Text that uses product data <p>{{ product.title }} is made to order.</p>
A widget from an app or service The single line the service gives you, such as a <div> with its own attributes

Keep each block to one job. If you need a delivery note and a widget, two blocks are easier to move and remove than one block with both.

A note on scripts: many widgets need two parts, a script that loads once for the whole site and a small line that marks where the widget shows. The script usually belongs in your theme's layout file, layout/theme.liquid, just before the closing </body> tag (Edit code in the theme menu). The Custom liquid block then only needs the small line. Putting the full script into the block on every product works on some setups but loads it in a less predictable place.

When the block does not show up

What you see Likely cause What to do
Visible in the editor, missing on the store You edited a theme that is not published Publish the copy, or make the same change on the live theme
Missing on some products Those products use a different template Add the block to that template too, or change the product's template
Empty space where it should be The code depends on something not on the page, such as a missing site script Add the site-wide script to theme.liquid
Shows on desktop, not on mobile A theme setting or the code hides it on small screens Check the block and section settings and the mobile preview
Error message in the editor A Liquid typo, such as an unclosed tag Paste the code again, or test a plain <p> first

If your store uses a page cache or a speed app, give it a minute and reload in a private window before assuming something is wrong.

Doing this with Provedly

The most common reason store owners look for this block is to place a real live visitor count under the buy buttons. With Provedly, install the Shopify app and switch on its app embed, which loads the script on every page. The Custom liquid block then only needs:

<div data-provedly-live data-style="card" data-template="{n} people are viewing this"></div>

The count is distinct visitors on that page in the last 90 seconds, from a heartbeat every 30 seconds, and it stays hidden below a minimum you set, 2 by default. data-style="card" shows a boxed version with a Verify link; leave it out for a single line in your theme's font. Add data-dot="off" to remove the dot. The full walkthrough, with screenshots, is in how to show a real people viewing count on any website.

You can also skip the Custom liquid block. In the app, open Widget, then Install, and click Add to product page: that adds the Product proof block to your product template with no code, ready to drag under the Buy buttons, and it can also show units sold and stock left. See real "only N left" and "N sold" on Shopify.

Frequently asked questions

Can I add a Custom liquid block to just one product?

Not directly, because blocks belong to a template. Create a new product template from the template picker, add the block there, and assign that template to the one product in its admin page.

Does a Custom liquid block slow down my product page?

The block itself is just text in the page. What you paste into it decides the cost. Plain HTML adds almost nothing; a heavy third-party script can. Load scripts asynchronously from the theme layout where you can.

Will my Custom liquid block survive a theme update?

Usually your blocks and their content stay when you update a theme through Shopify, but check the result on a copy first. Code you added in Edit code, such as in theme.liquid, may need to be added again after switching to a new theme.

Place a real live visitor count under your Buy buttons on Provedly's free plan by creating an account.

shopifyhorizon themecustom liquidtutorial

Get new articles by email

Honest social proof, verified purchases and what actually moves conversion. A few emails a month at most; leave with one click.

We email you once to confirm. Your address is used only for this newsletter; see the privacy policy.

Show proof you can stand behind.

Free plan, one site, 2,000 impressions a month, verified purchases included. The badge on the free plan links to your verification page, which is the point.