From the visual editor to advanced Liquid code — learn everything about editing Shopify themes, common customizations, and best practices for keeping your store safe while you experiment.
Whether you're a merchant who's never touched code or a developer looking to understand Shopify's templating system, this is your hub for everything related to Shopify theme editing.
Every Shopify theme is a collection of Liquid template files, along with CSS, JavaScript, and asset files. When a customer visits your store, Shopify processes these files, fills in your store's data, and sends the final HTML to the browser.
theme/
layout/ - Main wrappers (theme.liquid)
templates/ - Page types (product, collection, cart)
sections/ - Reusable page sections
snippets/ - Reusable code fragments
assets/ - CSS, JS, images, fonts
config/ - Theme settings and schema
locales/ - Translation files
Shopify provides two editing approaches — one visual and one code-based. Most merchants start with the visual editor and graduate to code.
Access from Online Store → Themes → Customize. Great for cosmetic changes.
What you CAN do:
What you CAN'T do:
Access from Online Store → Themes → Actions → Edit Code. Edit any Liquid, CSS, or JS file.
Always create a backup first
Go to Themes → Actions → Duplicate. Name it "Backup — [Date]". Make changes on the duplicate first.
The code editor gives you full access to every template file. For functional customizations like trust badges, countdown timers, and conditional content, this is where you'll work.
Liquid is Shopify's template language. It sits between your HTML and Shopify's data, dynamically displaying store content. There are three core building blocks.
Objects output data from your store using double curly braces.
{{ product.title }}
{{ product.price | money }}
{{ shop.name }}
{{ customer.first_name }}
Tags control what gets rendered using curly braces with percent signs.
{% if product.available %}
<button>Add to Cart</button>
{% else %}
<button disabled>Sold Out</button>
{% endif %}
Filters modify output data using the pipe character. They can be chained.
{{ product.title | upcase }}
{{ product.price | money_with_currency }}
{{ product.description | truncate: 100 }}
{{ 'now' | date: '%B %d, %Y' }}
{% if %} / {% elsif %} / {% else %}
Conditional logic
{% for %}
Loops — iterate over collections, product images, etc.
{% assign %}
Create variables
{% render %}
Include a snippet file (faster than include)
{% comment %}
Code comments — not rendered to the browser
{% capture %}
Capture multi-line content into a variable
The most frequently requested customizations, with code you can adapt for your own store.
Step 1: Create a new file called trust-badges.liquid in snippets/
Step 2: Add your badge HTML (see code example)
Step 3: Include it in your product section after the Add to Cart button:
{% render 'trust-badges' %}
For a professional, fully-styled version with multiple badge options, check the Trust Badge snippet on LiquidBoost.
<div class="trust-badges" style="display:flex;
gap:16px; justify-content:center;
padding:16px 0; flex-wrap:wrap;">
<div class="trust-badge"
style="text-align:center; font-size:12px;">
<svg width="32" height="32"
viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3
-8 3v7c0 6 8 10 8 10z"/>
</svg>
<p>Secure Checkout</p>
</div>
</div>
{% if settings.announcement_enabled %}
<div class="announcement-bar" style="background:{{ settings.announcement_bg }};
color:{{ settings.announcement_text }}; text-align:center; padding:10px;">
{{ settings.announcement_message }}
{% if settings.announcement_link != blank %}
<a href="{{ settings.announcement_link }}" style="color:inherit;
text-decoration:underline; margin-left:8px;">
{{ settings.announcement_link_text }}
</a>
{% endif %}
</div>
{% endif %}
For a scrolling version with multiple rotating messages, LiquidBoost's Scrolling Announcement Bar snippet handles animation and responsive behavior out of the box.
{% if product.selected_or_first_available_variant.inventory_quantity <= 5
and product.selected_or_first_available_variant.inventory_quantity > 0 %}
<p class="low-stock-warning" style="color:#e74c3c; font-weight:bold;">
Only {{ product.selected_or_first_available_variant.inventory_quantity }}
left in stock!
</p>
{% endif %}
Creates urgency for low-stock items. For an animated version with customizable thresholds, check the Availability Indicator snippet.
{% if product.compare_at_price > product.price %}
<div class="price-display">
<span class="sale-price" style="color:#e74c3c; font-weight:bold;">
{{ product.price | money }}
</span>
<span class="compare-price" style="text-decoration:line-through; color:#999;">
{{ product.compare_at_price | money }}
</span>
{% assign savings = product.compare_at_price | minus: product.price %}
<span class="savings-badge" style="background:#e74c3c; color:white;
padding:2px 8px; border-radius:4px; font-size:12px;">
Save {{ savings | money }}
</span>
</div>
{% else %}
<span class="regular-price">{{ product.price | money }}</span>
{% endif %}
The Price Display and Price Bubble snippets offer advanced versions with sale animations and percentage-off calculations.
Understanding the difference between sections and snippets — and knowing where to add CSS — is key to clean, maintainable theme code.
Self-contained content blocks with their own settings schema. They appear in the theme editor and can be added, removed, or reordered by merchants.
Best for: Page-level content blocks
Reusable code fragments included manually with {% render %}. Perfect for trust badges, social proof, price displays, and shared UI components.
Best for: Shared components & features
Add styles via Theme Settings (Custom CSS field), section-level {% style %} blocks, or the main theme stylesheet in assets/.
Best for: Visual changes & responsive design
Write Custom Code
Use Pre-Built Snippets
Install an App
Once you're comfortable with the basics, these techniques will level up your theme editing.
Store custom data on products, collections, and customers. Essential for displaying information beyond Shopify's standard fields.
{% if product.metafields.custom.care_instructions %}
<div class="care-instructions">
<h4>Care Instructions</h4>
{{ product.metafields.custom.care_instructions
| metafield_tag }}
</div>
{% endif %}
Modern themes use JSON templates that define which sections appear on a page. Makes it easy to add, remove, and reorder sections without touching Liquid.
{
"sections": {
"main": { "type": "main-product" },
"trust-badges": {
"type": "trust-badges",
"settings": {
"heading": "Shop with Confidence"
}
}
},
"order": ["main", "trust-badges"]
}
Shopify targets 50ms render time for Liquid templates. Keep your code fast.
Since Liquid runs server-side, debugging requires specific techniques.
Theme editing carries risk. One syntax error can break your entire storefront. Follow these golden rules.
Always duplicate your theme before editing — no exceptions
Preview changes before publishing
Make small changes and test frequently
Keep a change log — what, when, and why
Use version control (Shopify CLI supports git)
Don't panic — your store is backed up if you duplicated
Check the browser console (F12) for JavaScript errors
Look for Liquid syntax errors in the error message
Revert to your backup — publish the duplicate theme
Compare files between broken and backup to find the change
For serious theme work, install Shopify CLI. It lets you edit files locally, see live changes, use git for version control, and push only when ready.
npm install -g @shopify/cli
shopify theme dev
Yes, Shopify's visual theme editor lets you rearrange sections, change colors, update fonts, and configure settings. However, for custom functionality like trust badges, countdown timers, or conditional product content, you'll need to edit Liquid code or use pre-built snippets.
It's safe if you follow best practices: always duplicate your theme before making changes, preview before publishing, and make small incremental edits. If something breaks, you can instantly revert to your backup theme.
Liquid is Shopify's open-source template language that dynamically displays store data in your theme's HTML. It uses three building blocks: objects ({{ }}), tags ({% %}), and filters (|). It was created by Shopify and is used across the platform.
Go to Online Store > Themes > Edit Code. Open your product section file (usually sections/main-product.liquid). Add your code where you want it. Alternatively, create a snippet file and include it with {% render 'your-snippet' %}. For ready-made enhancements, browse LiquidBoost's marketplace.
Sections are self-contained content blocks with settings schemas — they appear in the theme editor and can be managed by merchants. Snippets are reusable code fragments included manually with {% render %}. Sections are for page-level blocks; snippets are for shared components.
For front-end features (trust badges, announcements, countdown timers, social proof), custom code or pre-built Liquid snippets are usually better — they're faster, cheaper, and independent. Apps are better for features needing backend processing like review management or email automation.
If you duplicated your theme before editing, publish the backup version from Online Store > Themes. If you didn't create a backup, you can sometimes revert individual files using Shopify's "Older versions" feature in the code editor, though it saves only limited history.
Don't want to write code from scratch? Browse LiquidBoost's marketplace for professional, conversion-tested Liquid snippets. One-time purchase, zero JavaScript, instant installation.