We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How can I hide custom liquid sections on mobile in the Dawn theme?

Solved

How can I hide custom liquid sections on mobile in the Dawn theme?

urbantis
Shopify Partner
220 0 65

Hi, I would like to hide  custom liquid sections from mobile (roses with new arrivals words)

Can you please help?

 

Website: https://rayeofhope.com/

password Tristin0805

 

Thanks

Accepted Solution (1)
suyash1
Shopify Partner
11112 1367 1751

This is an accepted solution.

@urbantis - sorry my mistake, did not put # before id, so please remove that line and use this

@media screen and (max-width:749px){
#shopify-section-template--15701762998467__7a98d4cb-9e18-4394-8c8d-88719a04ea9c{
    display: none;    visibility: hidden;}
}

 

To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com

View solution in original post

Replies 7 (7)

marcoswata
Shopify Partner
123 10 35

In the theme editor, go to /sections/custom-liquid.liquid

 

Find the  line with

"settings": [

And below that paste:

{"type":"checkbox", "id":"mobile_hide", "label":"Hide on mobile", "default":true}


Then find the line with:
<div class="color-{{ section.settings.color_scheme }} gradient">
And replace it with:
<div class="color-{{ section.settings.color_scheme }} gradient {% if section.settings.mobile_hide != blank %} small-hide{% endif %}">
 
 
If my answer was helpful then please Like and Accept Solution 🙂
If you need help with design, development or marketing your store, contact me!
urbantis
Shopify Partner
220 0 65

Thank you, when I add {"type":"checkbox", "id":"mobile_hide", "label":"Hide on mobile", "default":true}

under setting I get

 

error saving sections/custom-liquid.liquid

However I would like to hide a specific custom.liquid. not all of them, please let me know if you have time, thanks

marcoswata
Shopify Partner
123 10 35

@urbantis with my solution you should be able to hide specific custom Liquid sections, not just that specific one.
Sorry I forgot you need to add a comma after the setting.
So:

{"type":"checkbox", "id":"mobile_hide", "label":"Hide on mobile", "default":true},

 

If my answer was helpful then please Like and Accept Solution 🙂
If you need help with design, development or marketing your store, contact me!

suyash1
Shopify Partner
11112 1367 1751

@urbantis - add this css to the very end of your base.css file and check

@media screen and (max-width:749px){
shopify-section-template--15701762998467__7a98d4cb-9e18-4394-8c8d-88719a04ea9c{
    display: none;    visibility: hidden;}
}
To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com
urbantis
Shopify Partner
220 0 65

I tried this adding is at the bottom of base.css but it does not hide the section, what am I doing wrong?

suyash1
Shopify Partner
11112 1367 1751

This is an accepted solution.

@urbantis - sorry my mistake, did not put # before id, so please remove that line and use this

@media screen and (max-width:749px){
#shopify-section-template--15701762998467__7a98d4cb-9e18-4394-8c8d-88719a04ea9c{
    display: none;    visibility: hidden;}
}

 

To build shopify pages use PAGEFLY | Contact me - suyash.patankar@gmail.com
urbantis
Shopify Partner
220 0 65

Brilliant, thank you