alekone
alekone

Reputation: 127

Serving different images to different devices

I'm writing a responsive wordpress theme. I'd like to serve different image files (smaller) to mobile phone visitors, in order to save bandwidth. Is it possible to do something like this?

As of now, mobile visitors see css-resized images. thank you!

Upvotes: 0

Views: 344

Answers (2)

Grzesiek
Grzesiek

Reputation: 120

Different approach is to use get_browser()

http://www.php.net/manual/en/function.get-browser.php

it returns more user friendly output.

Upvotes: 1

Grzesiek
Grzesiek

Reputation: 120

It is possible. For example in PHP you have $_SERVER['HTTP_USER_AGENT']

http://php.net/manual/en/reserved.variables.server.php

thanks to this you can identify browser and system on witch it is running.

Example value is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586) As you can see thanks to this you can do some guessing, like filtering IOS and Android or maybe ARM architecture.

Regards, Grzesiek

Upvotes: 1

Related Questions