Shopify themes, liquid, logos, and UX
Hello, I'm looking for a way to hide a specific filter (género) from certain collection pages (menino-2-6-anos, menina-2-6-anos, rapaz-7-12-anos and rapariga-7-12-anos). How can I do this? Thanks!
Solved! Go to the solution
This is an accepted solution.
Hi @PetitFox, Pls remove my old code and replace this new code:
Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code
Step 2: Search file theme.liquid
Step 3: Insert this code above </head> tag:
{% 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(#Facet-1-template--23112144945501__product-grid) {
display: none !important;
}
</style>
{% endif %}
Hope this can help you,
If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Hi @PetitFox, Can you kindly share your store link (with the password protected, if any) with us? We will check it and suggest you a solution if possible.
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Sure, it's petitfoxportugal.myshopify.com
Hi @PetitFox,
Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code
Step 2: Search file theme.liquid
Step 3: Insert this code above </head> tag:
<style>
.disclosure-has-popup:has(#Facet-1-template--23112144945501__product-grid) {
display: none !important;
}
</style>
Here is result:
Hope this can help you,
If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
It worked! But I don't want to remove it from all the collection pages, only from a few. Is there a way of specifying the collections I don't want the "género" filter to show?
Hi @PetitFox, Which collections do you not want to appear?
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Menino (2-6 Anos); Menina (2-6 Anos); Rapariga (7-12 Anos) and Rapaz (7-12 Anos)
This is an accepted solution.
Hi @PetitFox, Pls remove my old code and replace this new code:
Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code
Step 2: Search file theme.liquid
Step 3: Insert this code above </head> tag:
{% 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(#Facet-1-template--23112144945501__product-grid) {
display: none !important;
}
</style>
{% endif %}
Hope this can help you,
If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
That's brilliant, it worked! Many thanks
@PetitFox, No problem. Have a good day 😍
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Hello again. I updated the theme and it seems this code isn't working anymore. Could I ask your help once again? Many thanks!
Hi @PetitFox,
1, Navigate to Online Store > Themes > Edit Code.
2, Locate and open the theme.liquid file.
3, Paste the code snippet provided below right before the closing head tag, then save your changes.
<script>
document.addEventListener("DOMContentLoaded", function() {
const currentURL = window.location.href;
const targetURLs = [
"https://petitfoxportugal.myshopify.com/collections/menino-2-6-anos",
"https://petitfoxportugal.myshopify.com/collections/menina-2-6-anos",
"https://petitfoxportugal.myshopify.com/collections/rapaz-7-12-anos",
"https://petitfoxportugal.myshopify.com/collections/rapariga-7-12-anos"
];
if (targetURLs.some(url => currentURL.startsWith(url))) {
const filterElement = document.querySelector("#Details-filter.p.m.custom.genero-template--23112144945501__product-grid");
if (filterElement) {
filterElement.style.display = "none";
}
}
});
</script>
We hope this assists in resolving the issue.
If you find our solution helpful, kindly consider Liking and Marking it as Accepted. Thank you!
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
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