WordPress.org

Ready to get started?Download WordPress

Forums

Two templates at the same time (4 posts)

  1. Barb82
    Member
    Posted 1 year ago #

    Hi all, I need to use two templates at the same time (one for desktop, one for mobile), as a client has requested that (so no responsive, for some reason...).

    Problem is, I tried some plugins that make the site switch according to the detected device, and they work without problems. I leave the desktop theme as active, and select in the plugin the mobile theme to use.

    But, if the theme have options or if there's a custom menu set, it doesn't show in mobile... for setting the options I can temporarily switch theme, change them, switch again (is time consuming but at least it works), but the custom menu settings is lost...

    There's a way to solve this?

    Thanks in advance

  2. mixmastermichael
    Member
    Posted 1 year ago #

    Wait, why can't you just use a responsive layout for this? If you want stuff to appear only in the mobile version, but not the desktop and vice versa, just make some elements in a div, and hide / show it depending on the screen size and media query you would set up.

    For example, on the desktop site:
    <div id="mobileonly"> Navgivation items</div>

    then in your css, set it up like:

    #mobileonly {
    display: none;
    }

    then set up a media query so that it's like:

    #mobileonly {
    display: inline;
    }

    .. make sense?

  3. Barb82
    Member
    Posted 1 year ago #

    Makes A LOT of sense and I would be really happy to use a responsive design, but for this particular work I can't (clients and their weird ideas)...

    I thought of your solution actually, before posting this, only it's a bit long to do, because the two templates that the client wants are totally different.

    It's doable, but I first wanted to check if I could get away with a more speedy solution... thanks anyway ^^

  4. mixmastermichael
    Member
    Posted 1 year ago #

    Cool. Yeah, clients are a bit cray cray these days haha, so I know how that goes.

    One other thought... just have basically two different wordpress sites and templates, and set up a javascript rule so that when it's viewed on the mobile version, there's an auto-redirect to the mobile version of the site instead of the desktop.

    so like example.com re-directs to m.example.com when it's viewed at a screen size of width of 450px.

Topic Closed

This topic has been closed to new replies.

About this Topic