Shopify themes, liquid, logos, and UX
Hello, I was looking for a way to hide a specific filter (gender) from certain collection pages (menino-2-6-anos, menina-2-6-anos, rapaz-7-12-anos and rapariga-7-12-anos).
I managed to get it to work on the desktop version by applying the code below in the theme.liquid just before the </head> tag, but it seems it's not working on the mobile version - I can still see the gender filter on those collections on mobile.
Can anyone help me adapt the code so it also works on mobile? I'm using the Dawn theme, and my website is petitfoxportugal.myshopify.com.
{% assign full_url = request.host | append: request.path %} {% if full_url contains 'menino-2-6-anos' or full_url contains 'menina-2-6-anos' or full_url contains 'rapaz-7-12-anos' or full_url contains 'rapariga-7-12-anos' %} <style> .disclosure-has-popup:has([aria-label="Género (0 selecionada)"]) { display: none!important; } </style> {% endif %}
Solved! Go to the solution
This is an accepted solution.
Hi @PetitFox
Replace on this one.
{% assign full_url = request.host | append: request.path %}
{% if full_url contains 'menino-2-6-anos' or full_url contains 'menina-2-6-anos' or full_url contains 'rapaz-7-12-anos' or full_url contains 'rapariga-7-12-anos' %}
<style>
.disclosure-has-popup:has([aria-label="Género (0 selecionada)"]) {
display: none!important;
}
.mobile-facets__details.js-filter:has([aria-controls="FacetMobile-1-template--23273162080605__product-grid"]) {
display: none !important;
}
</style>
{% endif %}
And Save.
Result:
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
This is an accepted solution.
Hi @PetitFox
Replace on this one.
{% assign full_url = request.host | append: request.path %}
{% if full_url contains 'menino-2-6-anos' or full_url contains 'menina-2-6-anos' or full_url contains 'rapaz-7-12-anos' or full_url contains 'rapariga-7-12-anos' %}
<style>
.disclosure-has-popup:has([aria-label="Género (0 selecionada)"]) {
display: none!important;
}
.mobile-facets__details.js-filter:has([aria-controls="FacetMobile-1-template--23273162080605__product-grid"]) {
display: none !important;
}
</style>
{% endif %}
And Save.
Result:
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
It worked! Many thanks for this
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025