Security, Tech & Programming
Shopify theme dev – blog author info

Shopify theme dev – blog author info

This post elaborates how to show the info of the blog author in your shopify theme. This will help you create the about the author block in your shopify 2.0 theme.

What will not work for blog author info

Initially, while trying to create about the author block, I tried using the simple {{ article.author }} , which did work to output the author name. However, that’s it, it will not give you any more details like bio, avatar etc.

How to get blog author info including bio, avatar, website link

To get the complete details of the blog author on your shopify theme, you have to use article.user like this:

Author name: {{ author.user.name }}
Author bio: {{ author.user.bio }}
Author first name: {{article.user.first_name}}
Author last name: {{article.user.last_name}}
Author email: {{article.user.email}}
Author website homepage link: {{ article.user.homepage }}

For image:
Author image: {{ article.user.image }}
For working paths of image:
{{ article.user.image | img_url }}
or specify a size
{{ article.user.image | img_url: 'original' }}

This did not work for me: 
Author avatar: {{ article.user.avatar | img_url: '100x100' }}

How to edit these settings for blog author?

These are the configurations found in: settings > users and permissions > (click on user name to edit). Then to add / edit the profile image / avatar, click on view account settings on top right of the page in above screenshot.

Info: The user object in shopify liquid api is: https://shopify.dev/docs/api/liquid/objects/user

Leave a Reply

Your email address will not be published. Required fields are marked *

Hire Me!