I'm have a lot of fun with this one! So I have the following code and it's not working. Should I be using a Thematic hook instead? Where am i going wrong with this? It does work with an absolute URL address, but I obviously do not want that in the event things change down the line.
function ipad_css() {
if( preg_match('/ipad/i',$_SERVER['HTTP_USER_AGENT'])) {?>
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/ipad.css" media="screen" />
<?php }
}
add_action('wp_print_styles','ipad_css');
In the event it matters, this is what is in my ipad.css stylesheet.
@import url('../style.css');
body.page {
background: #6d80b5;
}
body.page #ipad-back {
display: none;
}
#ipad-back {
background: url(images/menu-btn.png) no-repeat scroll 0 0 transparent;
height: 45px;
width: 134px;
float: right;
margin-bottom: 25px;
}
#ipad-back a {
display: inline-block;
color: #fff;
font-weight: bold;
position: relative;
top: 10px;
left: 25px;
}