I need to hire someone a lot smarter than myself to find a way to accomplish the following:
For just iPad users, I want the following meta tag to be applied:
Code: Select all
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
Don't laugh at my attempt but here's what I've tried without success . . . the code keeps showing up at the top of my web page or I get an error. I've also tried creating a user defined tag with the code to no avail.
I'm glad to pay someone to show me how to do this correctly, here's my code which I placed right after the <head> tag:
Code: Select all
{literal}
strstr($_SERVER['HTTP_USER_AGENT'],'iPad')
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPad')){
document.write("<meta name=\"\viewport\"\ content=\"\width=device-width, initial-scale=1, maximum-scale=1\"\ />");
} else {
echo ' ';
}
{/literal}