Hello, I have custom image sections below my collection banner image for all of my collections. I would like to remove this section from certain collections and leave it on others.
I have used the following code in theme.css, to remove these sections entirely from my mobile site. and I am wondering how I can tweak it to remove the content from the collections I no longer desire (on desktop and mobile).
@_media screen and (max-width:749px) {
.custom-collection-section .custom__item {
display: none!important;
To clarify, I am happy that the section does not display on any collections in mobile, but I would like to remove this section from just a few desktop collections as well.
Link to a collection I would like to remove the custom image section from: https://earthquake-outdoor-power-equipment.myshopify.com/collections/rear-tine-tillers
Password: Prieth
Solved! Go to the solution
Sorry for facing this issue, it's my pleasure to help us.
Welcome to the Shopify community!
and Thanks for your Good question.
i can see this code is working fine
Yes, it is possible
The way I would approach it however is not with css but with metafields.
As you are already using metafields, another collection metafield could be created to enable/disable the output of the current metafield data on a per collection bases.
Could you please send the liquid code that currently outputs the metafield data in the collections?
Hi, to target specific collections by css you would need to have a css names with the collection handle, which most themes do not have.
Also, each time you created a new collection you would need to add css code if you want to hide the metafields for that collection.
Can you please share the following:
- password to your site (here or by PM)
- theme you are using
- how did you implement the metafields output in the collection? using an app or custom code in theme?
hi @ARDI1960 did you fix the issue?
hi @ARDI1960, can I request collaborator access to your store to take a look at the code?
User | Count |
---|---|
400 | |
202 | |
146 | |
42 | |
42 |