- Short answer
- In Edit code, templates/article.json (Online Store 2.0) names the post's section; that section's file and any theme blocks it renders hold the code.
- Try first
- Theme editor sections, Custom CSS, or a new template made in the editor — no theme code to edit
- One post vs all
- Section code reaches every template naming it; an alternate template's own editor changes reach only its posts
- Template limit
- 1,000 templates per theme in total, blog post templates included
- Before editing
- Duplicate the theme; deleted theme files can't be recovered
- Theme updates
- If edits are incompatible, all code changes are removed from the updated copy; save a copy first
What can you change without editing code?
Shopify's code editor guidance says to edit theme code only if you can't make the change with a Shopify app or the theme editor. For posts, the editor covers three kinds of change:
- Sections and blocks: add, remove or rearrange them on the blog post template.
- Custom CSS: a setting on the theme and each section for changing your store's look without editing theme code.
- A new template: made from an existing one, it starts with the same sections, and you can change it without affecting posts that use the original.
You then pick the new template in a post's Theme template field in your admin. Our blog setup guide walks through that editor route.
What should you do before you edit theme code?
Shopify advises editing code only if you know HTML and CSS and have a basic understanding of Liquid, and you can edit a paid theme's code only after you've purchased it.
Then duplicate the theme as a backup, so you can discard your changes and start again. If your theme library is full, make room before you duplicate.
Code edits that don't conflict with a theme update are included in it; if they're incompatible, all your code changes are removed in the updated copy. Shopify says to always save a copy of any customized code before updating your theme.
Shopify's theme-update page, read October 21, 2026, leaves files in the Templates folder out of its list of code changes and doesn't say what happens to an edited article.json. How your edits fare in a manual update is covered separately.
Where is the blog post template in the code editor?
On an Online Store 2.0 theme, a post page is built from a JSON template, and Shopify's article template documentation says its HTML or Liquid code has to live in a section the template references.
- From your Shopify admin, go to Online Store, open the theme's menu and click Edit code.
- In the Templates folder, open
article.jsonfor single posts;blog.jsonrenders the blog page that lists all posts in a blog. - Note which section the template names: it's the
typevalue undersections, the section's filename without the extension. - Check how to change only some posts, then open that section's file and edit it there; that changes every template naming the section. On themes with theme blocks, such as Horizon, part of the markup can sit in block files in the blocks folder, and editing one changes every section that uses that block. Theme Check underlines some errors, such as missing templates, in red as you type.
- Online Store
- Themes
- Edit code
The same documentation says the article template or a section inside it should include the article object and the comment form, added with the Liquid form tag.
If the Templates folder holds the article template as a Liquid file instead, the code sits in that template itself: a template exists as JSON or Liquid, never both, and Liquid templates can't be used with sections.
How do you give some posts a different layout?
Any change to a template affects every post that uses it, so to display some posts differently, you can give them an alternate template. Make one in the theme editor, as covered above, or add one in the code editor, named after a valid template type plus an optional suffix, as in Shopify's JSON template example of product.alternate.json beside product.json. The same rule gives a post template such as article.name.json.
Changes you make to an alternate template in the theme editor reach only its posts, but an edit to a section file isn't contained that way. A template made from article.json starts with the same sections, and sections are available to any template by default, so editing a shared section's file still changes posts on both templates. One way to keep code to some posts is to have the alternate template name a different section file.
You assign the template in a post's Theme template field, which lists only your current live theme's templates, so one you add only in a duplicate theme won't show until that theme is live.
If you add a section to the JSON by hand, it must exist in the theme, and a section without presets in its schema can't then be removed in the theme editor.
A theme can hold 1,000 templates in total across all template types, blog posts included, and once it reaches that limit you can't create new JSON templates.
Renaming or deleting a template needs the code editor; posts that used a deleted template show the default one until you assign another.
This page was written by AI. Separate AI agents that did not write it check its figures and claims against official sources and test its links and interactive tools. A human editor sets the site's editorial direction, topics and rules and checks that pages are complete and display correctly, but does not check their facts or edit their text. Details may change — always confirm critical data at shopify.com.
Editorial Policy