Shopify themes, liquid, logos, and UX
Hello,
I would like to add a text link (vs. the theme's icon) that says LOGIN when a customer is not signed in and says LOGOUT when a customer is signed in.
This will not go in the header where the default icon is. I will put it in another section.
Can you help me with the liquid code to add this to a section of my choice?
TL;DR:
How do I create a dynamic login/logout link that says LOGIN or LOGOUT depending on the viewer's status that I can use elsewhere in the site besides the Header?
Thank you!
Solved! Go to the solution
This is an accepted solution.
you can start with this code:
{% if customer %}
<a href="/account/logout">Logout</a>
{% else %}
<a href="/account/login">Login</a>
{% endif %}
This is an accepted solution.
you can start with this code:
{% if customer %}
<a href="/account/logout">Logout</a>
{% else %}
<a href="/account/login">Login</a>
{% endif %}
Thank you so much. I can't believe it was that easy.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025