I have an image (desktop and mobile), which I only want to show on this page
https://theothelabel.com/collections/black-friday-sale
It is currently showing on all collection pages. How can I code this so it only shows on this one page?
Thanks
A user needed to display a specific image (desktop and mobile versions) exclusively on their Black Friday Sale collection page, as it was currently appearing across all collection pages.
Solutions Proposed:
Template-based approach: Create a dedicated collection template named “Black Friday Sale” through the theme customizer, assign it to the specific collection, and add the image directly within that template. This ensures the image only appears on the designated page.
Code-based solution: Add custom CSS/JavaScript code to the theme.liquid file before the closing </body> tag. The code uses conditional logic to check if the current collection handle matches “black-friday-sale” and displays the image only when true.
Outcome:
The issue was successfully resolved using one of the code-based solutions provided. The user confirmed it worked perfectly.
I have an image (desktop and mobile), which I only want to show on this page
https://theothelabel.com/collections/black-friday-sale
It is currently showing on all collection pages. How can I code this so it only shows on this one page?
Thanks
Hello @JoeyRoo
Go to Theme Customization:
Create a New Collection Template:
Assign the New Template to the Black Friday Collection:
Add Your Image to the New Template:
Hi,JoeyRoo
Custom coding is required for this page to tailor your collection’s specifications. If you’re willing, could you please share your URL and grant collaborator permissions, or feel free to DM
@JoeyRoo - please add following code in your theme.liquid file before
{% if collection.handle=="black-friday-sale" %}
{% elsif %}
{% endif %}
You can try this code by following these steps:
Step 1: Go to the online store ->Theme ->Edit Code.
Step 2: Find the theme.liquid file and add the following code before the tag
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!
This worked perfectly. Thanks ![]()
Glad to hear that Joey ![]()