Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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 129 Views
  • 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 Offline
    I Offline
    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 Offline
      arminunruhA Offline
      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 Offline
        I Offline
        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 Offline
          arminunruhA Offline
          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 Offline
            I Offline
            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 Offline
              arminunruhA Offline
              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
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              I also code custom websites or custom Lay features.
              šŸ’æ Email me here: šŸ’æ
              info@laytheme.com

              Before you post:
              1. When using a WordPress Cache plugin, disable it or clear your cache.
              2. Update Lay Theme and all Lay Theme Addons
              3. Disable all Plugins
              4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

              This often solves issues you might run into

              When you post:
              1. Post a link to where the problem is
              2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
              3. If the problem is difficult to explain, post screenshots / link to a video to explain it
              Online Users
              M
              matejmoravec
              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