Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Restricting Mobile View

  • magisterschwarz

    Mobile phones make my site look all out of sorts. Is there a way I can prevent viewers from seeing the site on mobile? It really is meant for desktop only.

  • Hi there,

    I’m not sure if there is a workaround for that. If a user opens the site on mobile, what should they be seeing then?

    Maybe you need to write a JavaScript that displays a message telling the user that the site is not accessible on mobile.

  • magisterschwarz

    “Maybe you need to write a JavaScript that displays a message telling the user that the site is not accessible on mobile.”

    I think that’s exactly what I need to do. Could you let me know how to do it?

    Thanks. I appreciate your help, as always!

  • Custom JS is out of the scope of the support forum, unfortunately.

    You can try this CSS:

    @media(max-width: 768px) { 
    body {
        display: none;
    }
    html:before {
        content: "Please view on desktop";
        padding: 10vh 5vw 10vh 5vw;
        display: block;
        text-align: center;
        font-size: 30px;
    }
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.