Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Set different home page for mobile

Set different home page for mobile

Scheduled Pinned Locked Moved General Discussion
6 Posts 2 Posters 771 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I
    I
    Ilina Catana
    wrote on last edited by
    #1

    Hey @arminunruh ! I'd like to set a different home page for mobile than for desktop. This topic was addressed in 2020 here but no "perfect" solution was really found. Maybe you have a better idea?

    Best!

    1 Reply Last reply
    0
    • arminunruhA
      arminunruhA
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      hey i think you need to use the custom phone layout feature

      1 Reply Last reply
      0
      • I
        I
        Ilina Catana
        wrote on last edited by
        #3

        Hey @arminunruh thanks for answering!

        This is also the idea I had. If my home page is the "Home" page and the "A" page is the page I would like to have on mobile instead of the "Home" page, I can create a mobile layout "Home - Mobile" that has the same design as my "A - Mobile" page and make sure that the "A" page does not appear in the mobile menu. But it requires my client to edit the "Home-Mobile" page manually every time he edits/changes the content of the "A" page. This is quite annoying.

        Isn't there a code solution where simply the Home page does not appear on mobile, and an existing page replaces it? That would be really ideal :=)

        1 Reply Last reply
        0
        • arminunruhA
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          how about this

          <script>
          if( jQuery('body').hasClass('slug-frontpage') && jQuery('html').hasClass('is-touchdevice') ){
          window.location.replace("http://www.google.com");
          }
          </script>
          

          make sure you use the correct slug for 'slug-frontpage'
          and you use the correct url to redirect to instead of http://www.google.com

          I 1 Reply Last reply
          0
          • arminunruhA arminunruh

            how about this

            <script>
            if( jQuery('body').hasClass('slug-frontpage') && jQuery('html').hasClass('is-touchdevice') ){
            window.location.replace("http://www.google.com");
            }
            </script>
            

            make sure you use the correct slug for 'slug-frontpage'
            and you use the correct url to redirect to instead of http://www.google.com

            I
            I
            Ilina Catana
            wrote on last edited by
            #5

            @arminunruh thank you very much for getting back to me!

            I tried the code, for some reason it doesn't work yet but I'll try again tomorrow. Here is what I tried:

            <script>
            if( jQuery('body').hasClass('https://www.ludwigschoepfer.de') && jQuery('html').hasClass('is-touchdevice') ){
            window.location.replace("https://www.ludwigschoepfer.de/index");
            }
            </script>

            Homepage is called "https://www.ludwigschoepfer.de", replace page should be "https://www.ludwigschoepfer.de/index" (by the way, the website is now online). I also tried as a slug-frontpage only '/home' without success.

            If you see at first glance what went wrong, don't hesitate to let me know :)

            Best!

            1 Reply Last reply
            0
            • arminunruhA
              arminunruhA
              arminunruh
              Global Moderator
              wrote on last edited by
              #6

              @Ilina-Catana said in Set different home page for mobile:

              if( jQuery('body').hasClass('https://www.ludwigschoepfer.de') && jQuery('html').hasClass('is-touchdevice') ){

              nono this is wrong hehe :D

              go here:
              https://laytheme.com/documentation/custom-css-styling.html

              see this video:
              Screenshot 2023-02-21 at 18.30.11.png

              u need to get the body class "slug-*" and use that, not te URL :D

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Online Users
              D
              Dawid
              L
              lstark
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search