Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Mobile version

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #152437
    gabbagabba
    Participant

    Hi, i’m working for a client on a wordpress site; http://www.tomrerdahl.no.

    And I am now creating a mobile version.

    I have managed to set up a mobile.css that “triggers” when on you are looking at the site on android. But if I need to change any .php-documents on the mobile version, or have different settings on some WP-plugins or javascripts, how do I do those changes ONLY for the mobile version?

    Using latest version of WP.

    Any help will be most appreciated.

    #152552
    Andy Howells
    Participant

    Why not go the responsive route and have media queries? What about people not using Android?

    You could take the CSS you’re using for the mobile version and put it inside a media query. Hey presto, every mobile is now sorted.

    #152566
    gabbagabba
    Participant

    I have a mobile.css. If you look at the site…

    And in that css I have:

    @media only screen and (max-device-width: 480px) { my css }

    But if I need to change any .php-documents on the mobile version, or have different settings on some WP-plugins or javascripts… thats what I can’t figure out…

    #152567
    gabbagabba
    Participant

    Thank you Melindrea. I’ll look into that!

    #152579
    Andy Howells
    Participant

    Ah apologies if I missed the point.

    You could use$_SERVER['HTTP_USER_AGENT'] before the main parts of your document are loaded.

    For example;

    $device = $_SERVER['HTTP_USER_AGENT'];
    if($device == 'DEVICESTRINGHERE') {
        // DO SOMETHING - for example, load relevant scripts/files etc
    }
    
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.