0

Is there any way to detect user phone type for wordpress??

I found some plugin but I would like to write the script myself.

Here is my situation. I need to change the web meta name viewport to

<meta name="viewport" content="width=320, minimal-ui">

when detect user is using iphone4 while load

<meta name="viewport" content="width=device-width, initial-scale=1.0">

during normal browsing.

Earlier, I found a method in wordpress to detect whether user is in mobile or not. But is there any method to detect the user phone type?

Adrian Preuss
  • 3,228
  • 1
  • 23
  • 43
Carson Lee
  • 2,673
  • 3
  • 20
  • 23
  • maybe a javascript will do see: http://stackoverflow.com/questions/13803838/detecting-if-a-device-is-able-to-change-orientation-in-javascript/13805337#13805337 – Vincent Panugaling Mar 27 '14 at 05:16
  • Check the `HTTP User Agent`. Its not an WordPress Question! – Adrian Preuss Mar 27 '14 at 05:19
  • @AdrianPreuss Can you explain how this is a PHP question? He doesn't even mention that he's *using* PHP, let alone asking anything about it. – Adi Inbar Mar 27 '14 at 05:33
  • @Adi Inbar, he can use many options to realize that. either with Javascript over `window.navigator.userAgent` otherwise with PHP `$_SERVER['HTTP_USER_AGENT']` – Adrian Preuss Mar 27 '14 at 05:38

0 Answers0