Show a custom div after 5th product in collection

Daniiltje
Tourist
12 0 2

I would like to show a custom div after the 5th product in my collection. Does anyone know how I can do this?

 

UmairA
Shopify Partner
872 85 173

Hi there @Daniiltje,

I believe it's possible. But you'll need to enlighten me on what you want to achieve exactly i.e where you want to display the Div? On all collections pages? or a specific collection page? 

Anyways, you can do so if you are comfortable with Liquid, HTML, and CSS code. You'll need to add an if condition to check if the product is the 5th from the queue and then add the div HTML element along with some styling as per your requirements.

Hope it helps.

Need help with theme customization or to add a new feature? Hire me
Email: umairabbascs@gmail.com
WhatsApp: WhatsApp
Theme customization | Custom coding | Store Setup | SEO Audit | Speed Optimization | Tweaks & Bugs fixing
0 Likes
Daniiltje
Tourist
12 0 2

@UmairA I just want to display some content in the div after the 5th product of any collection. How do I do  this using liquid?

0 Likes