Displaying Custom Author Names Using Metafields
- Driss
- September 7, 2020
By default, Shopify themes display blog post authors based on staff admin accounts. However, you can customize the article template to display any author name using metafields. This guide shows you how to feature guest bloggers with custom author names.
Prerequisites
- Access to Shopify admin panel
- Ability to edit theme code
- Metafields Guru app (or similar metafields management app)
Step-by-Step Instructions
1. Create a Theme Backup
From your Shopify admin, go to Online Store > Themes, and duplicate your active theme for safe editing.
2. Update the Article Template
- In your duplicated theme, navigate to the Sections folder
- Locate the
article-template.liquidfile - Replace the existing author display code:
|
|
With the following code:
|
|
3. Update the Blog Template
- In the same Sections folder, locate the
blog-template.liquidfile - Replace the existing author display code:
|
|
With the following code:
|
|
4. Configure Metafields for Custom Authors
- Install the Metafields Guru app or similar metafields management app
- Open the app and select Blogs & Posts
- Choose the blog post where you want to feature a guest author
- Click the Create Metafield button
- In the form:
- Set the Key to
name - Set the Namespace to
author - Enter the guest author’s name in the value field
- Set the Key to
- Click Save
Result
Once configured, the custom author name will appear on the blog post instead of the default staff account name.
Additional Notes
- The metafields approach allows you to have different author names for each blog post
- Make sure to test the changes on your development theme before applying to the live theme
- If your theme structure differs, locate the appropriate template files for articles and blog listings
For additional support, feel free to reach out via the contact form.