Using PHP to send different content to different devices
For content that could slow a mobile site down, we want to avoid sending anything to the mobile device at all. To do this, we need to adopt a server-side solution. PHP is a server-side language and is what drives WordPress, so happily we can make use of it to send different content to different devices, and so make our user experience and site speed better for mobile users.
In the previous chapter, we installed the mobble plugin and used the conditional functions it gave us to send different image files to different devices. We can use this technique with other content, too.
Let's try out this method by not sending the three Carborelli's home page images to smartphones. The following screenshot shows how they look on an iPhone:
We've made them appear smaller using CSS, but they are actually still large files and could slow our site down. So, let's use PHP to avoid sending them to smartphones altogether.