Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Set different home page for mobile

    General Discussion
    2
    6
    27
    Loading More Posts
    • 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
      Ilina Catana last edited by

      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 Reply Quote 0
      • arminunruh
        arminunruh Global Moderator last edited by

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

        1 Reply Last reply Reply Quote 0
        • I
          Ilina Catana last edited by

          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 Reply Quote 0
          • arminunruh
            arminunruh Global Moderator last edited by

            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 Reply Quote 0
            • I
              Ilina Catana @arminunruh last edited by

              @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 Reply Quote 0
              • arminunruh
                arminunruh Global Moderator last edited by

                @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 Reply Quote 0
                • First post
                  Last post
                Post a link to where the problem is
                I don't answer or check forum DMs, please just post on the forum.
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com

                Before you post:

                Use the Search Feature. Maybe there is already a solution to your issue.

                1. Update Lay Theme and all Lay Theme Addons
                2. Disable all Plugins
                3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
                4. Now see if your problem solved itself
                5. Go here, see if your problem is listed here:
                Troubleshooting

                When you post:
                1. Post a link to where the problem is
                2. If the problem is difficult to explain, post screenshots / link to a video to explain it

                Thanks!

                Online Users

                Q
                T
                Y
                L
                A
                K

                Recent Topics

                • A

                  With the updates my site has become very slow sloooooow

                • A

                  thanks for the update ...

                • A

                  Disable Rightclick and context menu for copyright reasons

                • A

                  back to home from any project should not go back to top at home

                laytheme.com