Displaying Custom Author Names Using Metafields

Displaying Custom Author Names Using Metafields

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

  1. In your duplicated theme, navigate to the Sections folder
  2. Locate the article-template.liquid file
  3. Replace the existing author display code:
1
2
3
4
5
{% if article.metafields.author.name %}
<span class="meta-sep">&#8226;</span>
{{ article.metafields.author.name }} {% else %}
<span class="meta-sep">&#8226;</span>
{{ article.author }} {% endif %}

With the following code:

1
2
3
4
{% if section.settings.article_author_enable %}
   <span class="meta-sep">&#8226;</span>
   {{ article.author }}
{% endif %}

3. Update the Blog Template

  1. In the same Sections folder, locate the blog-template.liquid file
  2. Replace the existing author display code:
1
2
3
4
5
{% if article.metafields.author.name %}
<span class="meta-sep">&#8226;</span>
{{ article.metafields.author.name }} {% else %}
<span class="meta-sep">&#8226;</span>
{{ article.author }} {% endif %}

With the following code:

1
2
3
4
{% if section.settings.blog_author_enable %}
   <span class="meta-sep">&#8226;</span>
   {{ article.author }}
{% endif %}

4. Configure Metafields for Custom Authors

  1. Install the Metafields Guru app or similar metafields management app
  2. Open the app and select Blogs & Posts
  3. Choose the blog post where you want to feature a guest author
  4. Click the Create Metafield button
  5. In the form:
    • Set the Key to name
    • Set the Namespace to author
    • Enter the guest author’s name in the value field
  6. 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.

Related Posts

How to Add an Accordion to Your Minimal Theme

How to Add an Accordion to Your Minimal Theme

An accordion is an effective way to display product descriptions in your e-commerce store, allowing …

Read More