ThemeShaper Forums » Thematic

[closed]

adding tweaks for the iphone

(4 posts)
  • Started 9 years ago by mellowvision
  • Latest reply from undertaker
  • This topic is resolved
  1. mellowvision
    Member

    Hi, I'm new to thematic and thematic feature site, but I've been trying to tweak it a bit for the iphone. I want to be able to call a seperate css file, and I've tried adding a typical conditional snippet I've used before, but I can't figgure out where to put the snippet.

    This is the code:
    <!--[if !IE]>–>
    <link media=”only screen and (max-device-width: 480px)”
    href=”iPhone.css” type=”text/css” rel=”stylesheet” />
    <!–<![endif]–>

    I've tried inserting it at the end of the head in the header.php file, and it breaks the rest of the page formatting... obviously not the spot. I CAN however, insert the
    <meta name="viewport" content="width=1200" />
    tag right before the end of the head, without any problems, and it works.

    So the question is, how and where is the best way to insert into the header? I feel like I've tried everywhere that makes sense, but nothing is working.

    Thanks for the help.

    Posted 9 years ago #
  2. You could use the browser body class...

    Look here: http://forums.themeshaper.com/topic/list-of-body-class-selectors-for-osbrowsers#post-14018

    this get tricky if you are using a caching plugin.

    -Gene

    Posted 9 years ago #
  3. mellowvision
    Member

    I found that using the following function in the feature site functions.php worked well.

    function childtheme_iP_style() { ?>
    <!--[if !IE]>-->
    <link rel="apple-touch-icon" href="news/icon_6060.png"/>
    <link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css">
    <!--<![endif]-->

    <?php }

    add_action('wp_head', 'childtheme_iP_style');

    Posted 9 years ago #
  4. undertaker
    Member

    How and where is the best way to insert into the header? I feel like I've tried everywhere that makes sense, but nothing is working.

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.