Jump to content

Two column on mobile product page only? Dont want it on every single page

Recommended Posts

@Lesum

Sure!

Artby-katya.com is the site and the code I used is below. I removed the code so right now, the website is still one column.

 

@media only screen and (max-width:767px) {
.products .list-grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.products .grid-item { width: 48%;
}
}

Edited by ArtLover777
Link to comment

Hey @ArtLover777! Sorry I didnt get to your youtube comment yet - I've got a lot to catch up on from taking Sunday off 😅 Anyhoo, to add code to a single page you'll need to use page header code injection for the storefront.

Click on the gear icon to access the store settings, then select advanced, then page header code injection.

Paste my code there between two style brackets so the browser knows it's CSS, like this:

<style>
@media only screen and (max-width:767px) {
.products .list-grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.products .grid-item { width: 48%;
}
}
</style>

 

Code queen and CSS behind InsideTheSquare.co

😃 Free CSS tutorials: insidethesquare.co/tutorials-for-squarespace
🥳 Free 7.1 training course: itssevenone.com/training
👍 CSS Cheat Sheet - codes for 7 & 7.1: insidethesquare.co/css
📚 CSS for Squarespace course: customcodeacademy.com

Link to comment
  • 1 month later...
2 hours ago, ArtLover777 said:

it seems to be coming up as one column on the left side only. Do you know if something may have changed?

@ArtLover777  On Squarespace 7.1, you no longer need code because it is now a built-in feature. Please see my recent post here:

Did this help? Please give feedback by clicking an icon below  ⬇️

About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too.

Link to comment
8 hours ago, ArtLover777 said:

Is there a way to only apply to certain pages and keep the one column design on others?

Sorry, I missed your point in the earlier posts about wanting it to affect just one of your Product Pages.

In that case, you'll want to set the built-in feature to a single column and then use this (newer) code (added to the page header injection) to show two columns on this page:

<style>
  /* Two columns on PLP */
  @media screen and (max-width: 767px) {
    .products.collection-content-wrapper .list-grid {
          grid-template-columns: repeat(2,minmax(0,1fr));
    }
  }
</style>

Did this help? Please give feedback by clicking an icon below  ⬇️

Edited by paul2009

About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too.

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.