Jump to content

Product 2 column mobile on all shop pages

Recommended Posts

I have used css to display products in a 2 column grid on mobile which is working on my main shop page, but it does not work on my other two shop pages. 

The code is under global css so cannot understand why it isn't being applied to all pages. I have also tried adding to code injection of those pages which did not work either. 

/* Product 2 columns mobile */
@media screen and (max-width:767px) {
    .products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column-gap: 10px;
}
}

This page is displaying correct - https://www.raegocreative.com.au/handmade

These pages are not - https://www.raegocreative.com.au/crochet-patternshttps://www.raegocreative.com.au/photography-prints

Screenshot 2024-06-05 at 7.44.58 am.png

Screenshot 2024-06-05 at 7.45.12 am.png

Link to comment
  • Replies 5
  • Views 300
  • Created
  • Last Reply

Top Posters In This Topic

17 hours ago, raego said:

I have used css to display products in a 2 column grid on mobile which is working on my main shop page, but it does not work on my other two shop pages. 

The code is under global css so cannot understand why it isn't being applied to all pages. I have also tried adding to code injection of those pages which did not work either. 

/* Product 2 columns mobile */
@media screen and (max-width:767px) {
    .products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column-gap: 10px;
}
}

This page is displaying correct - https://www.raegocreative.com.au/handmade

These pages are not - https://www.raegocreative.com.au/crochet-patternshttps://www.raegocreative.com.au/photography-prints

Screenshot 2024-06-05 at 7.44.58 am.png

Screenshot 2024-06-05 at 7.45.12 am.png

I checked that it is showing 2 columns in mobile view.

Have you figured it out?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
6 hours ago, Beyondspace said:

I checked that it is showing 2 columns in mobile view.

Have you figured it out?

It is only working on the first page, not on the second two pages, either in the editor or on any mobile device. 

Link to comment
Posted (edited)
On 6/8/2024 at 6:04 PM, tuanphan said:

I think it is an option in Shop Page, no need code

image.thumb.png.0dd0596dc5fb82519688f6cd

Thanks – unfortunately this still does not work. You can set it to two columns but they still do not align horizontally both in the editor and on the live site.

In my original post, this code fixes the problem on one shop page but not the others.

/* Product 2 columns mobile */
@media screen and (max-width:767px) {
    .products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column-gap: 10px;
}
}

 

Screenshot 2024-06-11 at 10.40.04 am.png

Edited by raego
Link to comment
On 6/11/2024 at 7:42 AM, raego said:

Thanks – unfortunately this still does not work. You can set it to two columns but they still do not align horizontally both in the editor and on the live site.

In my original post, this code fixes the problem on one shop page but not the others.

/* Product 2 columns mobile */
@media screen and (max-width:767px) {
    .products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-column-gap: 10px;
}
}

 

Screenshot 2024-06-11 at 10.40.04 am.png

To align title, you can use this code to Shop Page Header Code Injection (each page, you can use a different number). And do not use this code to Custom CSS, it can force your site layout break.

<style>
  @media screen and (max-width:767px) {
  figure.grid-image {
    min-height: 180px;
}
  }
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.