Show a Specific Number of Related Products | Squarespace 7.1

What does this code do?

Squarespace’s Related Products feature will show up to five related products. This code snippet will allow you to show less than five related products.

 

Code Snippet

Copy and paste the appropriate code into Design > Custom CSS.

/* Display One Related Product */ .ProductItem-relatedProducts .grid-item:nth-child(n+2) { display: none; } /* Display Two Related Products */ .ProductItem-relatedProducts .grid-item:nth-child(n+3) { display: none; } /* Display Three Related Products */ .ProductItem-relatedProducts .grid-item:nth-child(n+4) { display: none; } /* Display Four Related Products */ .ProductItem-relatedProducts .grid-item:nth-child(n+5) { display: none; }
 

How To Use It

  1. Copy and paste the code as indicated above.

Rebecca Grace

Rebecca Grace is a Squarespace CSS Expert and Website Designer.

https://rebeccagracedesigns.com
Previous
Previous

Customize the Input Text in a Form

Next
Next

Slideshow with Text and Buttons | Squarespace 7.1