Hide profile icon in header if not signed in?

Solved

Hide profile icon in header if not signed in?

jasminsharp97
Shopify Partner
44 0 18

I'm trying to hide the icon of the little person next to the cart icon in my store. I'm using the Lorenza theme. Ideally, I'd like to hide the profile icon unless someone is already signed in but if I don't have a way to qualify that then I'm ok hiding it all the time. I tried using the code:

.header__icon header__icon--account {
display: none!important;
}

and it didn't work. What am I doing wrong?

 

Store: https://66cdcb-86.myshopify.com/

Password: chohme

Accepted Solution (1)

Finer
Shopify Partner
2448 523 855

This is an accepted solution.

@jasminsharp97 you can place the following code in the theme.liquid file before the closing </head>-Tag 

{% unless customer %}
<style>
.header__icon.header__icon--account{
display:none!important;
}
</style>
{% endunless %}

Hiding the Icon will only apply to those who are not logged in.

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency

View solution in original post

Replies 6 (6)

Tech_Coding
Shopify Partner
297 76 66

Hello @jasminsharp97 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
@media (min-width: 60em) {
.header--default .header__icon--account{
display: none !important;
}
}
</style>

Tech_Coding_0-1726239549289.png

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.

websensepro
Shopify Partner
1214 134 155

Hi @jasminsharp97 ,

 

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code before </head>

 

<style>
@media (min-width: 60em) {
.header--default .header__icon--account{
     display: none !important;
   }
}
</style>

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial

BSS-TekLabs
Shopify Partner
2322 689 810
.header__icon.header__icon--account {
display: none!important;
}

Can you try this code @jasminsharp97 

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Finer
Shopify Partner
2448 523 855

This is an accepted solution.

@jasminsharp97 you can place the following code in the theme.liquid file before the closing </head>-Tag 

{% unless customer %}
<style>
.header__icon.header__icon--account{
display:none!important;
}
</style>
{% endunless %}

Hiding the Icon will only apply to those who are not logged in.

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency

BSSCommerce-B2B
Shopify Partner
1708 511 571

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </body> tag:

 

{% unless customer %}
  <style>
   .header__icon.header__icon--account{
     display: none !important;
   }
  </style>
{% endunless %}

 

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

PaulNewton
Shopify Partner
7055 629 1481

Hi @jasminsharp97  for the answers using the liquid conditions, if the theme has it use a site wide custom-liquid section or block if possible instead of editing theme code directly to not break automatic theme upgradability.

 

If available site wide would often be either in the header or footer section groups in the theme visual editor.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org