Blogs: Create an alternate blog template

If you have multiple blog categories with separate articles within (blog posts with blog categories), you can create an alternative blog template to display a different featured image for the main blog listing index.

1

Create a new template file

Open your code editor:
https://myshopify.com/admin/themes/current

In the templates folder, choose Create a new template:

Choose blog in the first dropdown and you can use alternate for the file name:

Choose the Create template button to complete.

Change the original code from:

to:

Save the file.

2

Create a new section file

In the Sections folder, choose Create a new section:

Call the file blog-two

Choose the Create section button to complete.

Erase all the default code that's generated:

Replace with all the code from this file (click the link to view code):

https://gist.githubusercontent.com/whistlerbrad/78ab390583d5ed4d46cf1b29f0f72c22/raw/6d8877778cee9cf79c9e2a448f9decb3f963633d/blog-two.liquid

Save the file.

3

Choose the new blog template for your second blog category

Open your Blog manager:
https://myshopify.com/admin/blogs

Choose the second blog category or the category you'd like to use the new template with.

Next, change the template on the lower right section:

Change to blog.alternate

Save the change:

1

Navigate to blog section in the Theme Editor

Before continuing, be sure to have a menu item created for the second blog so you can navigate to the blog category. Next, use the Theme Editor and navigate to the second blog.

https://myshopify.com/admin/themes/current/editor

Be sure you've navigated to the second blog category or the one you've applied the alternate template to. That's the only way to see the custom section options.

A new or different featured image or other settings be be applied to this blog category which is using the blog.alternate template:

Still need help? Contact Us Contact Us