• Hello, I tested the plugin WPtouch but that did not meet my expectations.
    I need that when my site is accessed by mobile devices, it displays only the categories clearly visible. So I thought about using a javascript at the beginning of the WP index to interpret the resolution of the visitor is less than 600px and redirect to another page.
    The script I’m using is this:

    if ($_GET[“op”] != “nomobile”) {
    echo(‘<script type=”text/javascript”>
    //<![CDATA[
    if (screen.width <= 600) {
    window.location.replace(“http://alternative-domain/&#8221;)
    }
    //]]>
    </script>’);
    }

    I did a test and opened a different page. But to my site set to open in a mobile device, I need to have two different style sheets, one for each type of resolution. I’m having trouble finding a way to do this. If you can load a second file of styles for those who use less than 600px resolution, I can almost ride a new template, just to access smarthphone, using the same database. Thanks if you can help. My site is http://autoguia.net

Viewing 1 replies (of 1 total)
  • Thread Starter enrico2012

    (@enrico2012)

    I studied a little and discovered that I can use some parameters when calling the CSS such as:

    <link rel=”stylesheet” href=”smartphones.css” media=”screen and (max-width:480px)” />

    In the template I used to make my site (twentyeleven) realized that it loads the CSS file header.php through this line:

    <link rel = “stylesheet” type = “text / css” media = “all” href = “<? php bloginfo (‘stylesheet_url’);?>” />

    I tried to replace the string that loads the CSS by the name of my new css file but failed. Does anyone know how to include it?

Viewing 1 replies (of 1 total)
  • The topic ‘two CSS style for smartphone resolution’ is closed to new replies.