Change function in responsive theme

WordPress has a function called wp_is_mobile. It does very simple User Agent checking, which isn’t very reliable. There are a lot of user agents out there and they can easily be falsified. There is no guarantee that a browser representing itself as some user agent actually is that user agent. You can do more complicated user agent checking but it is still user agent checking.

But you also don’t have a lot of choice with a server side script. I would use wp_is_mobile, or some more complicated version, to hedge my bets. It may save some load time in some, maybe many, cases. But make sure that media queries deal with the important stuff.

Leave a Comment