Jump to content

Re-direct homepage to mobile and tablet versions

Recommended Posts


I am looking for a custom code I can inject into my site so that the home page changes depending on your screen size. I was successful in doing this for desktop vs mobile, by making a new version of the homepage with url /mobile. And then I added this code to the desktop homepage header:



if (document.documentElement.clientWidth <760) {

 window.location = "/mobile";




I am trying to do the same thing now for a tablet version and no code adjustments seem to be working. Does anyone know of a custom code that would allow me to send tablet users to the tablet version of the homepage (/tablet)?

Thank you for your help!

For reference, my website is https://themilkmaidsupplyco.com/

Edited by themilkmaidsupplyco
added website link
Link to comment
  • Replies 1
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.