How To Call The Code To Add Author Bio In the Blog?

jt_osp
Tourist
11 0 3

Hello, I've been following this thread https://community.shopify.com/c/shopify-design/blog-post-author-and-bio/td-p/341507 to understand how to add author bio on Shopify blog at the bottom of article. I have added this code {% include 'author-bio' %} in the template-article.liquid at the place I want the code to show, so that's fine.

 

I have created author-bio.liquid to house the following code, with the images in Assets that correspond to the names, author-one.jpg and author-two.jpg, so I think it's still fine up to this point:

<div id="author-bios">
{% if article.author == 'Author One' %}
<img src="{{ 'author-one.jpg' | asset_url }}">
<h3>Josephine Wong</h3>
<p>A health and beauty enthusiast who is passionate about helping people to discover the best beauty trends and understand how high-performance home beauty devices can solve their facial and skincare problems naturally from the comforts of their own home. Loves following best tips, tricks and latest trends on anything and everything about anti-aging skincare.</p>

{% elsif article.author == 'Author Two' %}
<img src="{{ 'author-two.jpg' | asset_url }}">
<h3>Aimee Lee</h3>
<p>A fun and loving person who enjoys reading up and sharing the latest beauty info with others. Likes to pull late nights quite often, but also keen to know the most effective way to maintain good, healthy skin the night-owl way.</p>
{% endif %}
</div>

 

My problem is, I don't know how to call the code in my blog article. What should I input in the HTML? Since there are 2 different bios, how do I specify I want say, Author One's bio to appear in my blog article? I don't have much knowledge in coding and just experimenting around to get answers, so I really don't know how to go about this. Help is much appreciated!

Replies 3 (3)

jt_osp
Tourist
11 0 3

Ahh okay, found the solution and managed to add the bio at the bottom of the article finally with some styling. 

Parrat966
Tourist
3 0 4

@jt_osp can you explain how you were able to solve this? I'm looking to have this done for my website.

Wesley9
Excursionist
45 1 4

What is the solution? Cause I am looking for the same issue and Shopify does not support a author page.