Default Templates
While Ghost allows you to select different templates for individual posts, thereβs no built-in way to change the default template for all posts. This guide explains how to modify your theme files to make a custom template the default for all posts.
Understanding the Issue
Ghost themes typically include several post templates that you can select from the post editor:
However, if you want to use a custom template (like custom-post-classic.hbs
) as the default for all posts without selecting it manually each time, youβll need to modify your theme files.
Changing the Default Post Template
To change the default template for all posts, youβll need to edit your theme code:
- Locate the main post template file (
post.hbs
) - Find the custom template file you want to use as default (e.g.,
custom-post-classic.hbs
) - Replace the content of
post.hbs
with the content from your desired template
Editing Theme Files
To edit the theme files, follow these steps:
- Download a copy of the theme and unzip the theme archive
- Use a code editor of your choice (such as Visual Studio Code or Sublime Text) to make the changes
- Locate the
post.hbs
file (this is the default post template) - Also locate your desired template file (e.g.,
custom-post-classic.hbs
) - Make a backup copy of the original
post.hbs
file - Copy the entire content from your custom template file
- Paste it, replacing all content in the
post.hbs
file - Save the changes
- Re-zip the theme directory and upload it to your Ghost site
For detailed instructions on how to edit theme code, re-zip, and upload the modified theme, refer to the Editing Theme Code article.
When to Use This Method
Consider changing the default post template when:
- You consistently use the same custom template for most posts
- You want to maintain a consistent look across all posts
- You want to save time by avoiding manual template selection for each post
By following these steps, you can customize the default appearance of all posts on your Ghost site without having to select a template for each new post.